Multi-intent classification model training method and device, electronic equipment and storage medium

By obtaining intent labels and concatenating dialogue text in multi-intent recognition, and by utilizing the BERT module and multi-head attention mechanism to adjust model parameters, the problem of insufficient recognition of relationships between intents is solved, thereby improving the accuracy of multi-intent classification and the model's generalization ability.

CN115186094BActive Publication Date: 2026-05-29PING AN TECH (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2022-07-21
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing multi-intent recognition methods cannot effectively focus on the relationship between intents, resulting in the output of irrelevant intents when intents are close. Furthermore, traditional classification training methods destroy the weights of pre-trained models, reducing generalization ability and intent recognition accuracy.

Method used

By acquiring a pre-defined list of intent labels and historical user dialogue statements, converting them into dialogue text and concatenating them, using the BERT module to extract feature vectors, and combining a multi-head attention mechanism and a binary classification linear module, the attention level and loss value are calculated. The model parameters are then adjusted until the loss value is less than a threshold, resulting in a trained multi-intent classification model.

Benefits of technology

It improves the accuracy of multi-intent classification of dialogue text, makes full use of intent label information and semantic relevance, ensures that the model uses intent labels when recognizing intent, and enhances the model's generalization ability and intent recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115186094B_ABST
    Figure CN115186094B_ABST
Patent Text Reader

Abstract

The application relates to the field of natural languages, and discloses a multi-intent classification model training method and device, electronic equipment and a readable storage medium. The method comprises the following steps: obtaining a preset intent label list, historical user dialogue sentences and real intents of the historical user dialogue sentences, converting the historical user dialogue sentences into dialogue texts, splicing the dialogue texts and the preset intent label list to obtain spliced dialogue texts; using a BERT module, a multi-head attention mechanism module and a binary linear module in a preset multi-intent classification model to perform intent recognition on the spliced dialogue texts to obtain a multi-label text intent analysis result; calculating a loss value of the multi-intent classification model, and adjusting parameters of the preset multi-intent classification model according to the loss value until the loss value is smaller than a preset loss threshold value, so that a trained multi-intent classification model is obtained. The application can improve the accuracy of multi-intent classification of dialogue texts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing, and more particularly to a method, apparatus, electronic device, and readable storage medium for training a multi-intent classification model. Background Technology

[0002] Intent recognition is a key technology in the NLU module of a chatbot. In outbound call scenarios, user statements usually contain one or more intents. Recognizing one or more intents in a user statement can be called multi-intent recognition.

[0003] Currently, common multi-intent recognition methods use multiple binary classifiers to classify user statements into intents. Due to the lack of an attention mechanism, this method cannot focus on the relationship between intents, and if the intents are similar, it is easy to output irrelevant intents. In addition, traditional classification training methods can easily destroy the user statement weights stored in the pre-trained model, weaken the generalization ability of the pre-trained model, and thus reduce the accuracy of intent recognition. Furthermore, traditional intent classification does not use intent label information, which leads to a lower accuracy of intent recognition. Summary of the Invention

[0004] This invention provides a multi-intent classification model training method, apparatus, electronic device, and readable storage medium, with the aim of improving the accuracy of multi-intent classification of dialogue text.

[0005] To achieve the above objectives, the present invention provides a multi-intent classification model training method, the method comprising:

[0006] Obtain a preset intent tag list, historical user dialogue statements and the true intent of the historical user dialogue statements, convert the historical user dialogue statements into dialogue text, and concatenate the dialogue text with the preset intent tag list according to preset rules to obtain concatenated dialogue text.

[0007] The feature vector of the concatenated dialogue text is extracted using the BERT module in the preset multi-intent classification model to obtain the text vector and multi-label vector;

[0008] The attention level between the text vector and the multi-label vector is calculated using the multi-head attention mechanism module in the preset multi-intent classification model. Based on the attention level, the text vector associated with the multi-label vector is selected as the text label vector.

[0009] The text tag vector is classified using the binary classification linear module in the preset multi-intent classification model to obtain the multi-tag text intent analysis results;

[0010] Calculate the loss value between the multi-label text intent analysis result and the true intent, and adjust the preset multi-intent classification model parameters according to the loss value. Then return to the step of using the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector, until the loss value is less than the preset loss threshold, and obtain the trained multi-intent classification model.

[0011] Optionally, the step of calculating the attention level between the text vector and the multi-label vector using the multi-head attention mechanism module in a preset multi-intent classification model includes:

[0012] The text vector and the multi-label vector are linearly transformed using the first, second and third preset parameters in the multi-head attention mechanism module to obtain the text query vector, text key vector, text value vector, label query vector, label key vector and label value vector;

[0013] The text weight matrix is ​​obtained by using the normalized exponential function in the multi-head attention mechanism module to calculate the text query vector, the text key vector, and the text numerical vector.

[0014] The tag weight matrix is ​​obtained by using the normalized exponential function in the multi-head attention mechanism module to calculate the tag query vector, the tag key vector, and the tag numerical vector.

[0015] The similarity between the text weight matrix and the label weight matrix is ​​calculated to obtain the degree of attention between the text vector and the multi-label vector.

[0016] Optionally, the step of extracting feature vectors from the concatenated dialogue text using the BERT module in a preset multi-intent classification model to obtain text vectors and multi-label vectors includes:

[0017] The concatenated dialogue text is positionally encoded to obtain a concatenated text positional encoding vector;

[0018] The concatenated text position encoding vector is encoded using the encoder in the BERT module to obtain the concatenated text encoding vector;

[0019] The attention mechanism in the BERT module is used to calculate the weight value of the concatenated text encoding vector, and intent tags with weight values ​​exceeding a preset threshold are selected as intent tags of the dialogue text.

[0020] The text tag vector is obtained by decoding the concatenated text encoding vector after calculating the weight values ​​using the decoder in the BERT module.

[0021] The text tag vector is segmented to obtain a text vector and a multi-tag vector.

[0022] Optionally, converting the historical user dialogue statements into dialogue text includes:

[0023] The historical user dialogue statements are muted and denoised to obtain readable dialogue statements.

[0024] The readable dialogue statement is segmented into audio frames to obtain audio frames.

[0025] Acoustic features are extracted from the speech frame to obtain a multidimensional feature vector of the speech frame;

[0026] The state of the multidimensional feature vector is obtained by using a preset acoustic model to identify the state of the speech frame.

[0027] The states are combined to obtain the phonemes corresponding to the speech frame;

[0028] The phonemes are concatenated to obtain the word corresponding to the speech frame;

[0029] The words are combined to obtain the dialogue text.

[0030] Optionally, the step of inputting the text label vector into a binary classification linear module with a preset number of layers for layer-by-layer classification to obtain multi-label text intent analysis results includes:

[0031] The score of the text label vector is calculated using the scoring function in the binary classification linear module with the preset number of layers;

[0032] Based on the score of the text label vector, the activation function in the binary classification linear module with the preset number of layers is used to determine the category of the text label vector, and the category of the text label vector is output as the result of multi-label text intent analysis.

[0033] Optionally, the step of concatenating the dialogue text with the preset intent tag list according to preset rules to obtain the concatenated dialogue text includes:

[0034] Add a first preset special symbol to the beginning of the dialogue text to obtain the preliminary dialogue text;

[0035] A second preset special symbol is added to the interval between each intent label in the intent label list and to the beginning of the intent label list to obtain a preliminary intent label list;

[0036] The prepared dialogue text is concatenated with the prepared intent tag list to obtain the concatenated dialogue text.

[0037] Optionally, after calculating the loss value between the multi-label text intent analysis result and the true intent, the method further includes:

[0038] Determine whether the loss value is less than a preset loss threshold;

[0039] When the loss value is less than the loss threshold, the multi-intent classification model is output as the trained multi-intent classification model.

[0040] When the loss value is not less than the loss threshold, the preset multi-intent classification model parameters are adjusted according to the loss value.

[0041] To address the aforementioned problems, the present invention also provides a multi-intent classification model training apparatus, the apparatus comprising:

[0042] The text intent splicing module is used to obtain a preset intent tag list, historical user dialogue statements and the true intent of the historical user dialogue statements, convert the historical user dialogue statements into dialogue text, and splice the dialogue text with the preset intent tag list according to preset rules to obtain spliced ​​dialogue text.

[0043] The multi-intent classification model module is used to extract feature vectors from the concatenated dialogue text using the BERT module in the preset multi-intent classification model, to obtain text vectors and multi-label vectors. It uses the multi-head attention mechanism module in the preset multi-intent classification model to calculate the attention degree between the text vectors and the multi-label vectors, and selects the text vectors associated with the multi-label vectors as text label vectors based on the attention degree. It uses the binary classification linear module in the preset multi-intent classification model to classify the text label vectors to obtain the multi-label text intent analysis results.

[0044] The model parameter tuning module is used to calculate the loss value between the multi-label text intent analysis result and the true intent, and adjust the preset multi-intent classification model parameters according to the loss value. Then, it returns to the step of using the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector, until the loss value is less than the preset loss threshold, and the trained multi-intent classification model is obtained.

[0045] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:

[0046] Memory, storing at least one computer program; and

[0047] The processor executes the computer program stored in the memory to implement the multi-intent classification model training method described above.

[0048] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the multi-intent classification model training method described above.

[0049] This invention, through obtaining an intent tag list, historical user dialogue statements, and the true intent of those statements, converts the historical dialogue statements into dialogue text. This dialogue text is then concatenated with the intent tag list according to preset rules to obtain concatenated dialogue text. This fusion of intent tags and text content improves the accuracy of intent recognition. Next, the concatenated dialogue text is input into a preset multi-intent classification model for a series of encoding and decoding operations to obtain text vectors and multi-tag vectors. Intent tags matching the intent of the dialogue text are then selected, achieving intent matching. Furthermore, the multi-head attention mechanism and binary classification within the preset multi-intent classification model are utilized. The linear module performs intent recognition and intent classification on the dialogue text, ensuring that the multi-intent classification model can utilize intent tag information. It fully considers the correlation between dialogue text and intent tags, and between intent tags themselves, making full use of the semantic information between the dialogue text and each intent tag, thereby improving the accuracy of multi-intent classification of dialogue text. Finally, it calculates the loss value between the multi-tag text intent analysis result and the true intent, and adjusts the preset multi-intent classification model parameters based on the loss value until the loss value is less than a preset loss threshold, thus obtaining the trained multi-intent classification model. This ensures the improved accuracy of the multi-intent classification model in recognizing multiple intents in dialogue text. Therefore, the multi-intent classification model training method, apparatus, device, and storage medium provided by this invention can improve the accuracy of multi-intent classification of dialogue text. Attached Figure Description

[0050] Figure 1 This is a flowchart illustrating a multi-intent classification model training method provided in an embodiment of the present invention.

[0051] Figures 2 to 3 A detailed implementation flowchart of one step in a multi-intent classification model training method provided in an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of a multi-intent classification model training device provided in an embodiment of the present invention;

[0053] Figure 5 A schematic diagram of the internal structure of an electronic device that implements a model training method for multi-intent classification according to an embodiment of the present invention;

[0054] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0055] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0056] This invention provides a method for training a multi-intent classification model. The execution entity of the multi-intent classification model training method includes, but is not limited to, at least one of electronic devices, such as a server or a terminal, that can be configured to execute the method provided in this application. In other words, the multi-intent classification model training method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server can include an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0057] Reference Figure 1 The flowchart shown is a schematic diagram of a multi-intent classification model training method provided in an embodiment of the present invention. In this embodiment, the multi-intent classification model training method includes the following steps S1-S5:

[0058] S1. Obtain a preset intent tag list, historical user dialogue statements and the true intent of the historical user dialogue statements, convert the historical user dialogue statements into dialogue text, and concatenate the dialogue text with the preset intent tag list according to preset rules to obtain concatenated dialogue text.

[0059] In this embodiment of the invention, the preset intent tag list may be a set containing all intent tags, wherein all intent tags can be obtained by performing intent recognition on all historical user dialogue statements in local storage. The historical user dialogue statements may be user speech statements obtained in previous customer service dialogues or intelligent outbound call scenarios. For example, in a customer service dialogue scenario, "Hello, I am a customer service representative from [Company Name]" or "Hello, I want to pre-order a batch of [Product Name]" are historical user dialogue statements. The true intent of the historical user dialogue statements may be the pre-labeled intent tags of the historical user dialogue statements. For example, the true intent of the historical user dialogue statement "Hello, I want to pre-order a batch of [Product Name]" may be "product purchase," "product pre-order," or "online pre-order." The preset rules may be rules used to distinguish the intent tag list from the dialogue text.

[0060] In an optional embodiment of the present invention, a preset intent tag list can be obtained by performing intent recognition on all historical user dialogue statements, thereby ensuring that the intent list can comprehensively cover user dialogue statements and improve the accuracy of intent recognition. Furthermore, historical user dialogue statements can be randomly selected from the user dialogue statement database, thereby ensuring that the training results of the historical user dialogue statements can represent the accuracy of intent recognition of the current user dialogue statements, and the true intent of the historical user dialogue statements can be identified using a natural language processing model, ensuring that the model parameters can be optimized using the true intent, thereby improving the accuracy of multi-intent classification.

[0061] In this embodiment of the invention, the historical user dialogue statements are converted into dialogue text, which makes it easier for the historical user dialogue statements to be input from the model, thereby ensuring the smooth implementation of the model.

[0062] Specifically, converting the historical user dialogue statements into dialogue text includes:

[0063] The historical user dialogue statements are muted and denoised to obtain readable dialogue statements.

[0064] The readable dialogue statement is segmented into audio frames to obtain audio frames.

[0065] Acoustic features are extracted from the speech frame to obtain a multidimensional feature vector of the speech frame;

[0066] The state of the multidimensional feature vector is obtained by using a preset acoustic model to identify the state of the speech frame.

[0067] The states are combined to obtain the phonemes corresponding to the speech frame;

[0068] The phonemes are concatenated to obtain the word corresponding to the speech frame;

[0069] The words are combined to obtain the dialogue text.

[0070] In this embodiment of the invention, the preset acoustic model can be a classification model based on deep learning, which contains a large number of parameters for confirming the state corresponding to the speech frame. Furthermore, the parameters can be obtained by training with a large amount of speech data.

[0071] In one embodiment of the present invention, before starting speech recognition and converting to text, it is sometimes necessary to remove the silence at the beginning and end to reduce interference with subsequent steps. This silence removal operation is generally called VAD and can be implemented using signal processing techniques.

[0072] In one embodiment of the present invention, a moving window function can be used to perform speech framing on the readable dialogue statement.

[0073] Furthermore, in this embodiment of the invention, the dialogue text and the intent tag list are concatenated according to a preset rule to obtain concatenated dialogue text, ensuring that the intent tag list can fully cover the dialogue text, thereby completing the multi-intent tagging of the dialogue text.

[0074] In detail, as an optional embodiment of the present invention, refer to Figure 2 As shown, the step of concatenating the dialogue text with the preset intent tag list according to preset rules to obtain the concatenated dialogue text includes steps S11-S13:

[0075] S11. Add a first preset special symbol to the beginning of the dialogue text to obtain the preliminary dialogue text;

[0076] S12. Add a second preset special symbol to the interval between each intent label in the intent label list and to the beginning of the intent label list to obtain a preliminary intent label list;

[0077] S13. Concatenate the prepared dialogue text with the prepared intent tag list to obtain the concatenated dialogue text.

[0078] In this embodiment of the invention, the first preset special symbol may be [CLS], and the second preset special symbol may be [SEP].

[0079] An optional embodiment of the present invention adds a preset special symbol to the beginning of the dialogue text, which makes it easier for the model to clearly identify the location of the dialogue text to be read, thereby improving the efficiency of multi-intent recognition of dialogue text.

[0080] Another optional embodiment of the present invention saves the model from the step of text segmentation by adding special symbols between the dialogue text and each intent tag, thereby improving the efficiency of multi-intent recognition of dialogue text.

[0081] S2. Use the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector.

[0082] In this embodiment of the invention, the multi-intent classification model includes a BERT module, a multi-head attention mechanism module, and a binary classification linear module, wherein the BERT module can be a module based on the BERT model.

[0083] In this embodiment of the invention, the BERT module in a preset multi-intent classification model is used to extract the feature vector of the concatenated dialogue text, thereby obtaining the text vector and the multi-label vector. This enables the concatenated dialogue text to be vectorized, which facilitates the representation of the text vector by labels, thereby improving the integration of labels and text and improving the accuracy of multi-intent classification of dialogue text.

[0084] Furthermore, as an optional embodiment of the present invention, refer to Figure 3 As shown, the step of extracting the feature vector of the concatenated dialogue text using the BERT module in the preset multi-intent classification model to obtain the text vector and multi-label vector includes steps S21-S25:

[0085] S21. Perform position encoding on the concatenated dialogue text to obtain the concatenated text position encoding vector;

[0086] S22. Encode the concatenated text position encoding vector using the encoder in the BERT module to obtain the concatenated text encoding vector;

[0087] S23. Calculate the weight value of the concatenated text encoding vector using the attention mechanism in the BERT module, and select the intent tags whose weight values ​​exceed a preset threshold as the intent tags of the dialogue text.

[0088] S24. The concatenated text encoding vector after the calculated weight value is decoded using the decoder in the BERT module to obtain the text label vector;

[0089] S25. Segment the text tag vector to obtain the text vector and the multi-tag vector.

[0090] In this embodiment of the invention, the BERT module can be a BERT model that includes an encoder, an attention mechanism, and a decoder. The preset threshold can be a threshold set in advance by researchers to filter out intent tags that match the dialogue text.

[0091] In an optional embodiment of the present invention, the concatenated dialogue text is first positionally encoded to facilitate subsequent calculations of the attention mechanism, thereby ensuring the accuracy of intent recognition. Furthermore, the encoder-decoder principle, combined with the attention mechanism, is used to achieve intent matching of the dialogue text, and intent tags that match the intent of the dialogue text are selected, thereby completing the feature extraction of the dialogue text and obtaining text vectors and multi-tag vectors.

[0092] S3. Calculate the attention level between the text vector and the multi-label vector using the multi-head attention mechanism module in the preset multi-intent classification model, and select the text vector associated with the multi-label vector as the text label vector based on the attention level.

[0093] In this embodiment of the invention, the multi-head attention mechanism module can be an attention mechanism module with more accurate weight calculation based on a self-attention mechanism. The degree of attention can be calculated based on the weight matrix after normalization exponential function.

[0094] This invention utilizes a multi-head attention mechanism module in a pre-defined multi-intent classification model to calculate the degree of attention between the text vector and the multi-label vector, thereby completing the matching of labels and text, resulting in a higher degree of fusion between labels and text, and achieving the goal of improving the accuracy of multi-intent recognition.

[0095] Further, as an optional embodiment of the present invention, the step of calculating the attention level between the text vector and the multi-label vector using the multi-head attention mechanism module in the preset multi-intent classification model includes:

[0096] The text vector and the multi-label vector are linearly transformed using the first, second and third preset parameters in the multi-head attention mechanism module to obtain the text query vector, text key vector, text value vector, label query vector, label key vector and label value vector;

[0097] The text weight matrix is ​​obtained by using the normalized exponential function in the multi-head attention mechanism module to calculate the text query vector, the text key vector, and the text numerical vector.

[0098] The tag weight matrix is ​​obtained by using the normalized exponential function in the multi-head attention mechanism module to calculate the tag query vector, the tag key vector, and the tag numerical vector.

[0099] The similarity between the text weight matrix and the label weight matrix is ​​calculated to obtain the degree of attention between the text vector and the multi-label vector.

[0100] In this embodiment of the invention, the first, second, and third preset parameters can be parameter matrices obtained through multiple training and optimization processes. The normalized exponential function can be the softmax function. The similarity calculation can be a cosine similarity calculation or a vector dot product, etc.

[0101] In an optional embodiment of the present invention, the text vector and multi-label vector are transformed into a text weight matrix and a label weight matrix by a normalized exponential function, and the similarity between the text weight matrix and the label weight matrix is ​​calculated by a cosine similarity method. The similarity is used as the degree of attention between the text vector and the multi-label vector, thereby reducing the damage to the weights stored during the training of the BERT module during intent classification, thus improving the generalization ability of the multi-intent classification model and the accuracy of multi-intent classification.

[0102] Furthermore, in this embodiment of the invention, the text vector associated with the multi-label vector is selected as a text label vector based on the attention level, so that the fusion degree between the label and the text is higher, thereby improving the accuracy of multi-intent recognition.

[0103] In detail, as an optional embodiment of the present invention, the step of filtering the text vectors associated with the multi-label vectors as text label vectors based on the attention level includes:

[0104] Based on the attention level, obtain the text vector that is closest in similarity to each multi-label vector;

[0105] Each multi-label vector is concatenated with its corresponding text vector to obtain the text label vector.

[0106] In an optional embodiment of the present invention, each multi-label vector is concatenated with the text vector with the highest similarity according to the attention level to obtain a text label vector, so that the intent label information is used in subsequent classification, thereby improving the accuracy of multi-intent classification.

[0107] S4. Using the binary classification linear module in the preset multi-intent classification model, classify the text label vector to obtain the multi-label text intent analysis results.

[0108] In this embodiment of the invention, the binary classification linear module can be composed of multiple binary classification linear layers.

[0109] This invention utilizes a binary classification linear module in a preset multi-intent classification model to classify the text label vectors, obtain multi-label text intent analysis results, complete the intent recognition of the dialogue text, facilitate the calculation of the gap between the multi-label text intent analysis results and the true intent, thereby optimizing the multi-intent classification model and achieving the goal of improving the accuracy of intent recognition.

[0110] Further, as an optional embodiment of the present invention, the step of inputting the text label vector into a binary classification linear module with a preset number of layers for layer-by-layer classification to obtain multi-label text intent analysis results includes:

[0111] The score of the text label vector is calculated using the scoring function in the binary classification linear module with the preset number of layers;

[0112] Based on the score of the text label vector, the activation function in the binary classification linear module with the preset number of layers is used to determine the category of the text label vector, and the category of the text label vector is output as the result of multi-label text intent analysis.

[0113] In this embodiment of the invention, the scoring function can be a commonly disclosed scoring function for linear classifiers. The activation function can be the sign function.

[0114] In an optional embodiment of the present invention, a score for each text label vector is first calculated using a scoring function, and an activation function is used to determine which intent label in the binary classification linear module the text label vector belongs to, thereby achieving intent recognition of the text label vector.

[0115] S5. Calculate the loss value between the multi-label text intent analysis result and the true intent, and adjust the preset multi-intent classification model parameters according to the loss value. Then return to the step of using the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector, until the loss value is less than the preset loss threshold, and obtain the trained multi-intent classification model.

[0116] In this embodiment of the invention, the loss value can be a value calculated by a loss function, wherein the loss function can be the BCE function.

[0117] In an optional embodiment of the present invention, the BCE function is used to calculate the loss value between the multi-tag text intent analysis result and the true intent. The loss value can be used to directly determine whether the multi-tag text intent analysis result is the true intent tag of the historical user dialogue statement, thereby simplifying the intent reasoning process and speeding up parameter optimization.

[0118] An optional embodiment of the present invention can use the BCE function to calculate the loss value between the multi-label text intent analysis result and the true intent, thereby determining whether the multi-intent classification model meets the requirements, so as to ensure that the multi-intent classification model can improve the accuracy of multi-intent recognition of dialogue text.

[0119] Furthermore, as an optional embodiment of the present invention, after calculating the loss value between the multi-tag text intent analysis result and the true intent, the method further includes:

[0120] Determine whether the loss value is less than a preset loss threshold;

[0121] When the loss value is less than the loss threshold, the multi-intent classification model is output as the trained multi-intent classification model.

[0122] When the loss value is not less than the loss threshold, the preset multi-intent classification model parameters are adjusted according to the loss value.

[0123] In an optional embodiment of the present invention, the multi-intent classification model is subjected to different processing by determining whether the loss value is less than a preset loss threshold, so as to ensure that the multi-label text intent analysis results output by the multi-intent classification model achieve the purpose of improving the accuracy of intent recognition.

[0124] This invention, through obtaining an intent tag list, historical user dialogue statements, and the true intent of those statements, converts the historical dialogue statements into dialogue text. This dialogue text is then concatenated with the intent tag list according to preset rules to obtain concatenated dialogue text. This fusion of intent tags and text content improves the accuracy of intent recognition. Next, the concatenated dialogue text is input into a preset multi-intent classification model for a series of encoding and decoding operations to obtain text vectors and multi-tag vectors. Intent tags matching the intent of the dialogue text are then selected, achieving intent matching. Furthermore, the multi-head attention mechanism and binary classification within the preset multi-intent classification model are utilized. The linear module performs intent recognition and intent classification on the dialogue text, ensuring that the multi-intent classification model can utilize intent tag information. It fully considers the correlation between dialogue text and intent tags, and between intent tags themselves, making full use of the semantic information between the dialogue text and each intent tag, thereby improving the accuracy of multi-intent classification of dialogue text. Finally, it calculates the loss value between the multi-tag text intent analysis result and the true intent, and adjusts the preset multi-intent classification model parameters based on the loss value until the loss value is less than a preset loss threshold, thus obtaining the trained multi-intent classification model. This ensures the improved accuracy of the multi-intent classification model in recognizing multiple intents in dialogue text. Therefore, the multi-intent classification model training method provided by this invention can improve the accuracy of multi-intent classification of dialogue text.

[0125] like Figure 4 The diagram shown is a functional block diagram of the multi-intent classification model training device of the present invention.

[0126] The multi-intent classification model training device 100 of the present invention can be installed in an electronic device. Depending on the functions implemented, the multi-intent classification model training device 100 may include a text intent splicing module 101, a multi-intent classification model classification module 102, and a model parameter tuning module 103. The module in this invention can also be referred to as a unit, which is a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and is stored in the memory of the electronic device.

[0127] In this embodiment, the functions of each module / unit are as follows:

[0128] The text intent splicing module 101 is used to obtain a preset intent tag list, historical user dialogue statements and the true intent of the historical user dialogue statements, convert the historical user dialogue statements into dialogue text, and splice the dialogue text with the preset intent tag list according to preset rules to obtain spliced ​​dialogue text.

[0129] The multi-intent classification model classification module 102 is used to extract the feature vector of the concatenated dialogue text using the BERT module in the preset multi-intent classification model to obtain text vectors and multi-label vectors. It uses the multi-head attention mechanism module in the preset multi-intent classification model to calculate the attention degree between the text vectors and the multi-label vectors. Based on the attention degree, it selects the text vectors associated with the multi-label vectors as text label vectors. It uses the binary classification linear module in the preset multi-intent classification model to classify the text label vectors to obtain the multi-label text intent analysis results.

[0130] The model parameter tuning module 103 is used to calculate the loss value between the multi-label text intent analysis result and the true intent, and adjust the preset multi-intent classification model parameters according to the loss value, and then return to the step of using the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector, until the loss value is less than the preset loss threshold, and the trained multi-intent classification model is obtained.

[0131] like Figure 5 The diagram shown is a schematic representation of the electronic device used in this invention to implement the model training method for multi-intent classification.

[0132] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a multi-intent classification model training program.

[0133] The memory 11 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory 11 can include both internal and external storage units of the electronic device. The memory 11 can be used not only to store application software and various types of data installed on the electronic device, such as the code of a multi-intent classification model training program, but also to temporarily store data that has been output or will be output.

[0134] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules (such as multi-intent classification model training programs) stored in the memory 11, and calls data stored in the memory 11 to perform various functions of the electronic device and process data.

[0135] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to enable communication between the memory 11 and at least one processor 10, etc. For ease of illustration, only one thick line is used in the figure, but this does not indicate that there is only one bus or one type of bus.

[0136] Figure 5 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 5The structure shown does not constitute a limitation on the electronic device and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0137] For example, although not shown, the electronic device may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0138] Optionally, the communication interface 13 may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is typically used to establish communication connections between the electronic device and other electronic devices.

[0139] Optionally, the communication interface 13 may further include a user interface, which may be a display, an input unit (such as a keyboard), or, optionally, a standard wired or wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.

[0140] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0141] The multi-intent classification model training program stored in the memory 11 of the electronic device is a combination of multiple computer programs, which, when run in the processor 10, can achieve the following:

[0142] Obtain a preset intent tag list, historical user dialogue statements and the true intent of the historical user dialogue statements, convert the historical user dialogue statements into dialogue text, and concatenate the dialogue text with the preset intent tag list according to preset rules to obtain concatenated dialogue text.

[0143] The feature vector of the concatenated dialogue text is extracted using the BERT module in the preset multi-intent classification model to obtain the text vector and multi-label vector;

[0144] The attention level between the text vector and the multi-label vector is calculated using the multi-head attention mechanism module in the preset multi-intent classification model. Based on the attention level, the text vector associated with the multi-label vector is selected as the text label vector.

[0145] The text tag vector is classified using the binary classification linear module in the preset multi-intent classification model to obtain the multi-tag text intent analysis results;

[0146] Calculate the loss value between the multi-label text intent analysis result and the true intent, and adjust the preset multi-intent classification model parameters according to the loss value. Then return to the step of using the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector, until the loss value is less than the preset loss threshold, and obtain the trained multi-intent classification model.

[0147] Specifically, the processor 10's implementation method of the above-mentioned computer program can be found in [reference needed]. Figure 1 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.

[0148] Furthermore, if the modules / units integrated into the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable medium can be non-volatile or volatile. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0149] Embodiments of the present invention may also provide a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:

[0150] Obtain a preset intent tag list, historical user dialogue statements and the true intent of the historical user dialogue statements, convert the historical user dialogue statements into dialogue text, and concatenate the dialogue text with the preset intent tag list according to preset rules to obtain concatenated dialogue text.

[0151] The feature vector of the concatenated dialogue text is extracted using the BERT module in the preset multi-intent classification model to obtain the text vector and multi-label vector;

[0152] The attention level between the text vector and the multi-label vector is calculated using the multi-head attention mechanism module in the preset multi-intent classification model. Based on the attention level, the text vector associated with the multi-label vector is selected as the text label vector.

[0153] The text tag vector is classified using the binary classification linear module in the preset multi-intent classification model to obtain the multi-tag text intent analysis results;

[0154] Calculate the loss value between the multi-label text intent analysis result and the true intent, and adjust the preset multi-intent classification model parameters according to the loss value. Then return to the step of using the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector, until the loss value is less than the preset loss threshold, and obtain the trained multi-intent classification model.

[0155] Furthermore, the computer's usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, applications required for at least one function, etc.; and the data storage area may store data created based on the use of blockchain nodes, etc.

[0156] In the several embodiments provided by this invention, it should be understood that the disclosed electronic devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0157] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0158] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0159] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0160] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0161] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0162] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The term "second class" is used to indicate names and does not indicate any specific order.

[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for training a multi-intent classification model, characterized in that, The method includes: Obtain a preset intent tag list, historical user dialogue statements and the true intent of the historical user dialogue statements, convert the historical user dialogue statements into dialogue text, and concatenate the dialogue text with the preset intent tag list according to preset rules to obtain concatenated dialogue text. The feature vector of the concatenated dialogue text is extracted using the BERT module in the preset multi-intent classification model to obtain the text vector and multi-label vector; The attention level between the text vector and the multi-label vector is calculated using the multi-head attention mechanism module in the preset multi-intent classification model. Based on the attention level, the text vector associated with the multi-label vector is selected as the text label vector. The text tag vector is classified using the binary classification linear module in the preset multi-intent classification model to obtain the multi-tag text intent analysis results; Calculate the loss value between the multi-label text intent analysis result and the true intent, and adjust the preset multi-intent classification model parameters according to the loss value. Then return to the step of using the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector, until the loss value is less than the preset loss threshold, and the trained multi-intent classification model is obtained. The step involves extracting feature vectors from the concatenated dialogue text using the BERT module in a pre-defined multi-intent classification model, resulting in text vectors and multi-label vectors, including: The concatenated dialogue text is positionally encoded to obtain a concatenated text positional encoding vector. The encoder in the BERT module encodes the concatenated text positional encoding vector to obtain a concatenated text encoding vector. The attention mechanism in the BERT module calculates the weight value of the concatenated text encoding vector, and selects intent tags with weight values ​​exceeding a preset threshold as intent tags of the dialogue text. The decoder in the BERT module decodes the concatenated text encoding vector after the calculated weight values ​​to obtain a text tag vector. The text tag vector is then segmented to obtain a text vector and a multi-tag vector.

2. The multi-intent classification model training method as described in claim 1, characterized in that, The step of calculating the attention level between the text vector and the multi-label vector using the multi-head attention mechanism module in the preset multi-intent classification model includes: The text vector and the multi-label vector are linearly transformed using the first, second and third preset parameters in the multi-head attention mechanism module to obtain the text query vector, text key vector, text value vector, label query vector, label key vector and label value vector; The text weight matrix is ​​obtained by using the normalized exponential function in the multi-head attention mechanism module to calculate the text query vector, the text key vector, and the text numerical vector. The tag weight matrix is ​​obtained by using the normalized exponential function in the multi-head attention mechanism module to calculate the tag query vector, the tag key vector, and the tag numerical vector. The similarity between the text weight matrix and the label weight matrix is ​​calculated to obtain the degree of attention between the text vector and the multi-label vector.

3. The multi-intent classification model training method as described in claim 1, characterized in that, The step of converting the historical user dialogue statements into dialogue text includes: The historical user dialogue statements are muted and denoised to obtain readable dialogue statements. The readable dialogue statement is segmented into audio frames to obtain audio frames. Acoustic features are extracted from the speech frame to obtain a multidimensional feature vector of the speech frame; The state of the multidimensional feature vector is obtained by using a preset acoustic model to identify the state of the speech frame. The states are combined to obtain the phonemes corresponding to the speech frame; The phonemes are concatenated to obtain the word corresponding to the speech frame; The words are combined to obtain the dialogue text.

4. The multi-intent classification model training method as described in claim 1, characterized in that, The text label vectors are input into a binary classification linear module with a preset number of layers for layer-by-layer classification to obtain multi-label text intent analysis results, including: The score of the text label vector is calculated using the scoring function in the binary classification linear module with the preset number of layers; Based on the score of the text label vector, the activation function in the binary classification linear module with the preset number of layers is used to determine the category of the text label vector, and the category of the text label vector is output as the result of multi-label text intent analysis.

5. The multi-intent classification model training method as described in claim 1, characterized in that, The step of concatenating the dialogue text with the preset intent tag list according to preset rules to obtain the concatenated dialogue text includes: Add a first preset special symbol to the beginning of the dialogue text to obtain the preliminary dialogue text; A second preset special symbol is added to the interval between each intent label in the intent label list and to the beginning of the intent label list to obtain a preliminary intent label list; The prepared dialogue text is concatenated with the prepared intent tag list to obtain the concatenated dialogue text.

6. The multi-intent classification model training method as described in claim 1, characterized in that, After calculating the loss value between the multi-label text intent analysis result and the true intent, the method further includes: Determine whether the loss value is less than a preset loss threshold; When the loss value is less than the loss threshold, the multi-intent classification model is output as the trained multi-intent classification model. When the loss value is not less than the loss threshold, the preset multi-intent classification model parameters are adjusted according to the loss value.

7. A multi-intent classification model training apparatus, used to implement the multi-intent classification model training method as described in any one of claims 1-6, characterized in that, The device includes: The text intent splicing module is used to obtain a preset intent tag list, historical user dialogue statements and the true intent of the historical user dialogue statements, convert the historical user dialogue statements into dialogue text, and splice the dialogue text with the preset intent tag list according to preset rules to obtain spliced ​​dialogue text. The multi-intent classification model module is used to extract feature vectors from the concatenated dialogue text using the BERT module in the preset multi-intent classification model, to obtain text vectors and multi-label vectors. It uses the multi-head attention mechanism module in the preset multi-intent classification model to calculate the attention degree between the text vectors and the multi-label vectors, and selects the text vectors associated with the multi-label vectors as text label vectors based on the attention degree. It uses the binary classification linear module in the preset multi-intent classification model to classify the text label vectors to obtain the multi-label text intent analysis results. The model parameter tuning module is used to calculate the loss value between the multi-label text intent analysis result and the true intent, and adjust the preset multi-intent classification model parameters according to the loss value. Then, it returns to the step of using the BERT module in the preset multi-intent classification model to extract the feature vector of the concatenated dialogue text to obtain the text vector and multi-label vector, until the loss value is less than the preset loss threshold, and the trained multi-intent classification model is obtained.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor to enable the at least one processor to perform the multi-intent classification model training method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the model training method for multi-intent classification as described in any one of claims 1 to 6.