Intention slot recognition model training method and device, and electronic device
By calculating the total loss value of the model during the training of the intent slot recognition model and combining it with the slot prediction results of relevant characters of business interest, the problem of poor slot prediction in the existing technology is solved, and the accuracy of slot recognition is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING CO WHEELS TECH CO LTD
- Filing Date
- 2022-05-25
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, the intention-slot recognition model is trained solely based on the fusion of loss values for intention and slot, resulting in poor slot prediction.
By inputting training samples into the initial intent slot recognition model, intent prediction results and slot prediction results are obtained. Target slot prediction results for characters relevant to business interests are then obtained from the slot prediction results. Combining the intent prediction results, slot prediction results, and labeled data from the training samples, the total loss value of the model is calculated. The initial intent slot recognition model is then trained based on the total loss value.
This improved the performance of the trained intent slot recognition model in recognizing slots for characters of business interest, thereby increasing the accuracy of slot recognition.
Smart Images

Figure CN117194617B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of human-computer dialogue and natural speech understanding, and in particular to a training method, apparatus and electronic device for an intent slot recognition model. Background Technology
[0002] Intent slot recognition models are mainly used in specific scenarios within dialogue systems for information recognition, such as telephone scenarios, music scenarios, and navigation scenarios. Through intent slot recognition models, dialogue systems can identify the intent and slot information based on the dialogue content, and thus provide timely feedback based on the identified intent and slot information.
[0003] In related technologies, training an intent slot recognition model based solely on the fusion of loss values for intent and slot results in poor slot prediction of the trained intent slot recognition model. Summary of the Invention
[0004] To address the aforementioned issues, this application provides a training method, apparatus, and electronic device for an intent slot recognition model.
[0005] According to a first aspect of this application, a method for training an intent slot recognition model is provided, comprising:
[0006] The training samples are input into the initial intent slot recognition model to obtain the intent prediction results and slot prediction results corresponding to the training samples.
[0007] Based on the labeled data of the training samples, the target slot prediction result is obtained from the slot prediction result; the target slot prediction result is the slot prediction result of the characters related to business interest in the training samples.
[0008] The intention prediction result, the slot prediction result, and the target slot prediction result are compared and calculated with the labeled data of the training samples to obtain the total loss value of the model.
[0009] Based on the total loss value of the model, the initial intent slot recognition model is trained to obtain a trained intent slot recognition model.
[0010] In some embodiments of this application, the labeled data of the training samples includes the intent label and slot label of the training samples; the step of comparing and calculating the intent prediction result, the slot prediction result, and the target slot prediction result with the labeled data of the training samples to obtain the total model loss value includes:
[0011] The intent label of the training sample and the intent prediction result are compared and calculated to obtain the intent loss value;
[0012] The slot label of the training sample and the slot prediction result are compared and calculated to obtain the slot loss value;
[0013] Obtain the target slot label from the slot labels of the training samples; the target slot label is the slot label of the character in the training samples that is relevant to the business.
[0014] The target slot label and the target slot prediction result are compared and calculated to obtain the target slot loss value;
[0015] The model's total loss value is obtained by performing calculations based on the intention loss value, the slot loss value, and the target slot loss value.
[0016] The step of performing calculations based on the intent loss value, the slot loss value, and the target slot loss value to obtain the total model loss value includes:
[0017] The total loss value of the model is obtained by weighting the intention loss value, the first weight of the intention loss value, the slot loss value, the second weight of the slot loss value, the target slot loss value, and the third weight of the target slot loss value.
[0018] As one possible implementation, the first weight is obtained in the following way:
[0019] The training samples are divided into N batches; where N is an integer greater than 1.
[0020] The i-th batch of samples is input into the (i-1)-th intention optimization intention slot recognition model to obtain the i-th intention prediction result of the i-th batch of samples; where i is a positive integer less than or equal to N; when i = 1, the (i-1)-th intention optimization intention slot recognition model is the initial slot recognition model;
[0021] Based on the intent label of the i-th batch sample and the i-th intent prediction result, the i-th intent loss value is obtained and added to the intent loss value sequence;
[0022] Based on the i-th intention loss value, the intention slot recognition model after the i-1th intention optimization is trained to obtain the intention slot recognition model after the i-th intention optimization.
[0023] After obtaining the intent slot recognition model after the Nth intent optimization, the N intent loss values in the intent loss value sequence are averaged to obtain the first average value;
[0024] The first average value is processed to obtain the first weight.
[0025] As one possible implementation, the second weight is obtained in the following way:
[0026] The training samples are divided into N batches; where N is an integer greater than 1.
[0027] The j-th sample is input into the (j-1)-th optimized slot recognition model to obtain the j-th slot prediction result of the j-th batch of samples; wherein, j is a positive integer less than or equal to N; when j=1, the (j-1)-th optimized slot recognition model is the initial slot recognition model;
[0028] Based on the slot label of the j-th batch of samples and the prediction result of the j-th slot, the loss value of the j-th slot is obtained and added to the slot loss value sequence;
[0029] The intention slot recognition model after the (j-1)th slot optimization is trained based on the j-th slot loss value to obtain the j-th slot optimization intention slot recognition model.
[0030] After obtaining the intention slot recognition model after the Nth slot optimization, the N slot loss values in the slot loss value sequence are averaged to obtain the second average value.
[0031] The second average value is processed to obtain the second weight.
[0032] As one possible implementation, the third weight is obtained in the following way:
[0033] The training samples are divided into N batches; where N is an integer greater than 1.
[0034] The m-th sample is input into the (m-1)-th optimized target slot recognition model to obtain the m-th slot prediction result of the m-th batch of samples. Based on the labeled data of the m-th batch of samples, the m-th target slot prediction result is obtained from the m-th slot prediction result. Wherein, m is a positive integer less than or equal to N. When m = 1, the (m-1)-th optimized target slot intention slot recognition model is the initial slot recognition model.
[0035] Based on the target slot label of the mth batch sample and the prediction result of the mth target slot, obtain the loss value of the mth target slot and add the loss value of the mth target slot to the target slot loss value sequence;
[0036] The intention slot recognition model after the (m-1)th target slot optimization is trained based on the loss value of the m-th target slot to obtain the intention slot recognition model after the m-th target slot optimization.
[0037] After obtaining the intention slot recognition model after the Nth optimization of the target slot, the N target slot loss values in the target slot loss value sequence are averaged to obtain the third average value.
[0038] The third average value is processed to obtain the third weight.
[0039] According to a second aspect of this application, a training apparatus for an intent slot recognition model is provided, comprising:
[0040] The first acquisition module is used to input training samples into the initial intent slot recognition model to obtain the intent prediction result and slot prediction result corresponding to the training samples;
[0041] The second acquisition module is used to obtain the target slot prediction result from the slot prediction result based on the labeled data of the training sample; the target slot prediction result is the slot prediction result of the characters related to business interest in the training sample.
[0042] The third acquisition module is used to compare and calculate the intention prediction result, the slot prediction result and the target slot prediction result with the labeled data of the training samples respectively, and obtain the total loss value of the model.
[0043] The training module is used to train the initial intent slot recognition model based on the total loss value of the model, so as to obtain a trained intent slot recognition model.
[0044] In some embodiments of this application, the labeled data of the training samples includes the intent labels and slot labels of the training samples; the third acquisition module includes:
[0045] The first acquisition unit is used to compare and calculate the intent label of the training sample with the intent prediction result to obtain the intent loss value;
[0046] The second acquisition unit is used to compare and calculate the slot label of the training sample with the slot prediction result to obtain the slot loss value.
[0047] The third acquisition unit is used to acquire target slot labels from the slot labels of the training samples; the target slot labels are the slot labels of characters in the training samples that are related to business interests.
[0048] The fourth acquisition unit is used to compare and calculate the target slot label and the target slot prediction result to obtain the target slot loss value;
[0049] The fifth acquisition unit is used to acquire the total model loss value based on the intention loss value, the slot loss value, and the target slot loss value.
[0050] Specifically, the fifth acquisition unit is used for:
[0051] The total loss value of the model is obtained by weighting the intention loss value, the first weight of the intention loss value, the slot loss value, the second weight of the slot loss value, the target slot loss value, and the third weight of the target slot loss value.
[0052] In some embodiments of this application, the apparatus further includes a fourth acquisition module, which is specifically used for:
[0053] The training samples are divided into N batches; where N is an integer greater than 1.
[0054] The i-th batch of samples is input into the (i-1)-th intention optimization intention slot recognition model to obtain the i-th intention prediction result of the i-th batch of samples; where i is a positive integer less than or equal to N; when i = 1, the (i-1)-th intention optimization intention slot recognition model is the initial slot recognition model;
[0055] Based on the intent label of the i-th batch sample and the i-th intent prediction result, the i-th intent loss value is obtained and added to the intent loss value sequence;
[0056] Based on the i-th intention loss value, the intention slot recognition model after the i-1th intention optimization is trained to obtain the intention slot recognition model after the i-th intention optimization.
[0057] After obtaining the intent slot recognition model after the Nth intent optimization, the N intent loss values in the intent loss value sequence are averaged to obtain the first average value;
[0058] The first average value is processed to obtain the first weight.
[0059] In some embodiments of this application, the apparatus further includes a fifth acquisition module, which is specifically used for:
[0060] The training samples are divided into N batches; where N is an integer greater than 1.
[0061] The j-th sample is input into the (j-1)-th optimized slot recognition model to obtain the j-th slot prediction result of the j-th batch of samples; wherein, j is a positive integer less than or equal to N; when j=1, the (j-1)-th optimized slot recognition model is the initial slot recognition model;
[0062] Based on the slot label of the j-th batch of samples and the prediction result of the j-th slot, the loss value of the j-th slot is obtained and added to the slot loss value sequence;
[0063] The intention slot recognition model after the (j-1)th slot optimization is trained based on the j-th slot loss value to obtain the j-th slot optimization intention slot recognition model.
[0064] After obtaining the intention slot recognition model after the Nth slot optimization, the N slot loss values in the slot loss value sequence are averaged to obtain the second average value.
[0065] The second average value is processed to obtain the second weight.
[0066] In some embodiments of this application, the apparatus further includes a sixth acquisition module, which is specifically used for:
[0067] The training samples are divided into N batches; where N is an integer greater than 1.
[0068] The m-th sample is input into the (m-1)-th optimized target slot recognition model to obtain the m-th slot prediction result of the m-th batch of samples. Based on the labeled data of the m-th batch of samples, the m-th target slot prediction result is obtained from the m-th slot prediction result. Wherein, m is a positive integer less than or equal to N. When m = 1, the (m-1)-th optimized target slot intention slot recognition model is the initial slot recognition model.
[0069] Based on the target slot label of the mth batch sample and the prediction result of the mth target slot, obtain the loss value of the mth target slot and add the loss value of the mth target slot to the target slot loss value sequence;
[0070] The intention slot recognition model after the (m-1)th target slot optimization is trained based on the loss value of the m-th target slot to obtain the intention slot recognition model after the m-th target slot optimization.
[0071] After obtaining the intention slot recognition model after the Nth optimization of the target slot, the N target slot loss values in the target slot loss value sequence are averaged to obtain the third average value.
[0072] The third average value is processed to obtain the third weight.
[0073] According to a third aspect of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method described in the first aspect above.
[0074] According to a fourth aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method described in the first aspect above.
[0075] According to a fifth aspect of this application, a vehicle is provided, the vehicle including the electronic equipment described in the third aspect above.
[0076] According to the technical solution of this application, by inputting training samples into an initial intent slot recognition model, intent prediction results and slot prediction results corresponding to the training samples are obtained. Target slot prediction results for characters relevant to business interests are extracted from the slot prediction results. Based on the intent prediction results, slot prediction results, target slot prediction results, and labeled data of the training samples, the total model loss value is obtained. The initial intent slot recognition model is then trained based on this total model loss value to obtain a trained intent slot recognition model. In this solution, the slot prediction results for characters relevant to business interests are incorporated when calculating the total model loss value, thereby improving the slot recognition performance of the trained intent slot recognition model for characters relevant to business interests, and thus effectively improving the slot recognition accuracy of the trained intent slot recognition model.
[0077] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0078] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0079] Figure 1 A flowchart illustrating a training method for an intent slot recognition model provided in an embodiment of this application;
[0080] Figure 2 This is a flowchart illustrating the process of obtaining the total loss value of the model in this embodiment of the application;
[0081] Figure 3 This is a flowchart illustrating the process of obtaining the first weight, the second weight, and the third weight in an embodiment of this application.
[0082] Figure 4 A structural block diagram of a training device for an intent slot recognition model provided in an embodiment of this application;
[0083] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0084] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0085] It should be noted that the intent slot recognition model is mainly used in specific scenarios of dialogue systems for information recognition, such as telephone scenarios, music scenarios, navigation scenarios, etc. Through the intent slot recognition model, the dialogue system can identify the intent and slot information based on the dialogue content, and thus provide timely feedback based on the identified intent and slot information.
[0086] In related technologies, training an intent slot recognition model based solely on the fusion of loss values for intent and slot results in poor slot prediction of the trained intent slot recognition model.
[0087] To address the aforementioned issues, this application provides a training method for an intent slot recognition model.
[0088] Figure 1 This is a flowchart illustrating a training method for an intent slot recognition model provided in an embodiment of this application. It should be noted that the training method for the intent slot recognition model in this application can be applied to the training device for the intent slot recognition model in this application, and the training device for the intent slot recognition model in this application can be configured in an electronic device. In some embodiments of this application, the trained intent slot recognition model can be used in the natural language understanding module of a human-computer dialogue system to identify the intent and slot information of the dialogue content. Figure 1 As shown, the method includes the following steps:
[0089] Step 101: Input the training samples into the initial intent slot recognition model to obtain the intent prediction results and slot prediction results corresponding to the training samples.
[0090] In some embodiments of the present application, the training samples may include a large number of conversation texts manually proposed in human-machine conversations. At the same time, the training samples may also include the intent annotation and slot annotation data for each conversation text. Usually, the training samples may be conversation texts corresponding to the actual application scenario domain. The initial intent slot recognition model may be an untrained model or a pre-trained intent slot recognition model, and the present application does not limit this. In addition, the initial intent slot recognition model may be an intent slot recognition model to be trained in related technologies such as BiGRU+CRF model, Transformer, etc., or a neural network model constructed by those skilled in the art based on actual needs.
[0091] It should be noted that the conversation texts in the training samples may first be subjected to word segmentation processing to split different characters and obtain a sequence representation after word segmentation processing. Among them, the word segmentation processing may include splitting Chinese, Korean, Japanese characters and punctuation marks in the text, and may also include combining English and numbers into one word. In addition, the sequence representation after word segmentation processing is converted into an id sequence according to a preset dictionary, and then the obtained id sequence is input into the initial intent slot recognition model. That is to say, the sequence representation after word segmentation processing is converted into a vector form to be input into the initial intent slot recognition model.
[0092] Among them, the intent prediction result refers to the user demand predicted based on the conversation text in the training sample and corresponding to the conversation text. As an example, if the word segmentation sequence corresponding to the conversation text is "Hello, help me open the window", the intent prediction result may be to open the window. The slot prediction result refers to the slot label prediction result corresponding to each character in the word segmentation sequence of the conversation text, and it may be a sequence composed of the slot label prediction values corresponding to each character. As an example, if the word segmentation sequence corresponding to the conversation text is "Hello, help me open the window", the corresponding slot prediction result may be "O O O O O OB-device I-device", where O, B-device, and I-device are all preset slot labels.
[0093] Step 102, based on the annotation data of the training sample, obtain the target slot prediction result from the slot prediction result; the target slot prediction result is the slot prediction result of the characters related to the business concern in the training sample.
[0094] In some embodiments of the present application, the labeled data of the training samples may include the relevant characters in the training samples that are of concern to the business. For example, for the training sample "Hello, please open the window", the corresponding labeled data includes "window", which is used to indicate that "window" is the relevant character in the training sample that is of concern to the business. Therefore, based on the labeled data of the training samples, the relevant characters in the training samples that are of concern to the business can be determined, and then the slot prediction results of the relevant characters in the training samples that are of concern to the business can be selected from the slot prediction results as the target slot prediction results.
[0095] In some other embodiments of the present application, the labeled data in the training samples may include the slot labels of the training samples, and the types of the slot labels include the first slot label type of the relevant characters in the training samples that are of concern to the business and the second slot label type of the characters that are not relevant to the business. Generally, based on the actual application scenario, it can be preset in advance which slot labels are included in the first slot label type and which slot labels are included in the second slot label type. In this way, the relevant characters in the training samples that are of concern to the business can be obtained according to the type of the slot labels of the training samples in the labeled data. As a way of implementation, based on the slot labels of the training samples, the characters whose slot label types are the first slot label type can be obtained, and these characters can be determined as the relevant characters in the training samples that are of concern to the business; then the slot prediction results of the relevant characters in the training samples that are of concern to the business can be selected from the slot prediction results and used as the target slot prediction results.
[0096] As an example, if it is preset in advance that the slot label of the second slot label type is "O", and if the segmented sequence corresponding to the dialogue text is "Hello, help me open the window", and the slot labels in the corresponding labeled data are "O O O O O OB-device I-device", then it can be determined that the relevant characters in the training sample that are of concern to the business are "car" and "window"; if the slot prediction result is "O O B-open O O O B-device I-device", then the target slot result obtained from this slot prediction result is the slot prediction results corresponding to the characters "car" and "window", that is, "B-device I-device".
[0097] Step 103: Compare and calculate the intent prediction result, the slot prediction result, and the target slot prediction result with the labeled data respectively to obtain the total loss value of the model.
[0098] It's important to note that the number of business-relevant characters in the training samples is typically much smaller than the number of business-irrelevant characters. Therefore, when calculating the total model loss, the slot prediction results of business-relevant characters can be incorporated; that is, the target slot prediction results can be included in the calculation of the total model loss. In this way, the total model loss can separately represent the losses of the intent prediction results, slot prediction results, and target slot prediction results. Thus, when training the model based on this total model loss, not only can the model's intent optimization results and slot prediction results for business-irrelevant characters be optimized, but also the model's slot prediction results for business-relevant characters can be optimized, thereby improving the model's training performance.
[0099] In some embodiments of this application, a total model loss function can be preset, and this function is used to characterize the relationship between the total model loss value and the intention prediction result, slot prediction result, target slot prediction result and the labeled data of the training samples. In this way, the total model loss value can be obtained by comparing and calculating the intention prediction result, slot prediction result and target slot prediction result with the labeled data of the training samples according to the preset total model loss function.
[0100] In some other embodiments of this application, the labeled data of the training samples may include intent labels and slot labels of the training samples. Therefore, the intent prediction result, slot prediction result, and target slot prediction result are compared and calculated with the labeled data of the training samples to obtain the intent loss value, slot loss value, and target slot loss value. Then, based on the intent loss value, slot loss value, and target slot loss value, the total model loss value is obtained. Here, the intent loss value refers to the difference between the intent prediction result and the true intent, the slot loss value refers to the difference between the slot prediction result and the true slot, and the target slot loss value refers to the difference between the target slot prediction result and the true target slot.
[0101] Step 104: Based on the total loss value of the model, train the initial intent slot recognition model to obtain the trained intent slot recognition model.
[0102] In other words, based on the total loss value of the model, the model parameters of the initial intent slot recognition model are continuously updated until the total loss value of the model reaches the expected value, or the number of training rounds reaches the expected value, and the training of the model is completed to obtain a trained intent slot recognition model.
[0103] As an example, the total loss value of the model can be input into the optimizer to update the model parameters, thereby enabling the training of the initial intent slot recognition model. The optimizer can be the Adam optimizer.
[0104] The training method for the intent slot recognition model according to embodiments of this application involves inputting training samples into an initial intent slot recognition model to obtain intent prediction results and slot prediction results corresponding to the training samples. From the slot prediction results, target slot prediction results for characters relevant to business interests are obtained. Based on the intent prediction results, slot prediction results, target slot prediction results, and labeled data of the training samples, the total model loss value is obtained. Based on the total model loss value, the initial intent slot recognition model is trained to obtain a trained intent slot recognition model. In this scheme, the slot prediction results for characters relevant to business interests are incorporated when calculating the total model loss value, thereby improving the slot recognition performance of the trained intent slot recognition model for characters relevant to business interests, and thus effectively improving the slot recognition accuracy of the trained intent slot recognition model.
[0105] The process of obtaining the total loss value of the model will be described in detail below.
[0106] Figure 2 This is a flowchart illustrating the process of obtaining the total loss value of the model in an embodiment of this application. In some embodiments of this application, the labeled data of the training samples includes the intent labels and slot labels of the training samples. For example... Figure 2 As shown, the implementation process of step 103 in 1 may include the following steps:
[0107] Step 201: Compare and calculate the intent labels and intent prediction results of the training samples to obtain the intent loss value.
[0108] In some embodiments of this application, the intent loss value is used to characterize the loss between the intent prediction result output by the model and the true intent, wherein the intent label of the training sample is the true intent of the dialogue text in the training sample. As an example, the intent loss value can be calculated by comparing the intent label of the training sample and the intent prediction result using the cross-entropy loss function.
[0109] Step 202: Compare and calculate the slot label and slot prediction result of the training sample to obtain the slot loss value.
[0110] In some embodiments of this application, the slot loss value is used to characterize the loss between the slot prediction result output by the model and the actual slot, where the slot label of the training sample is the actual slot of the dialogue text in the training sample. As an example, the dialogue text is "Hello, please open the car window for me," and the corresponding slot prediction result is "OOO B-open OO B-device I-device," with the corresponding slot label being "OOOOOO B-device I-device." The loss value can be obtained by comparing "OO O B-open OO B-device I-device" with "OOOOOO B-device I-device." For example, the slot loss value can be calculated based on the cross-entropy loss function, according to the slot label of the training sample and the slot prediction result.
[0111] Step 203: Obtain the target slot label from the slot labels of the training samples; the target slot label is the slot label of the character related to business interest in the training samples.
[0112] In some embodiments of this application, preset slot labels for characters unrelated to the business can be obtained, and then target slot labels can be obtained from the slot labels of the training samples based on these slot labels. As an example, if the slot label for a character unrelated to the business is "O", then slot labels that are not "O" can be filtered out from the slot labels of the training samples, and these non-"O" slot labels can be used as target slot labels.
[0113] In some other embodiments of this application, if the labeled data of the training samples also includes identification information of characters related to business interest in the training samples, this identification information can be, for example, the start and end positions of the characters related to business interest in the training samples, or it can be directly the characters related to business interest in the training samples. In this way, based on the identification information of the characters related to business interest in the labeled data, the slot labels of the characters related to business interest can be obtained from the slot labels of the training samples, and used as the target slot labels.
[0114] Step 204: Compare and calculate the target slot label and the target slot prediction result to obtain the target slot loss value.
[0115] In some embodiments of this application, the target slot loss value is used to characterize the loss between the predicted target slot and the actual target slot, where the target slot label is the actual target slot in the dialogue text of the training samples. As an example, the target slot loss value can be obtained by comparing the target slot label and the predicted target slot based on the cross-entropy loss function.
[0116] Step 205: Perform calculations based on the intention loss value, slot loss value, and target slot loss value to obtain the total model loss value.
[0117] In some embodiments of this application, the total model loss value can be obtained by performing calculations based on the intention loss value, slot loss value, and target slot loss value using a preset calculation method.
[0118] In some other embodiments of this application, the implementation process of step 205 may include:
[0119] Step 205-1: Perform a weighted calculation based on the intent loss value, the first weight of the intent loss value, the slot loss value, the second weight of the slot loss value, the target slot loss value, and the third weight of the target slot loss value to obtain the total model loss value.
[0120] The first weight of the intentional loss value, the second weight of the slot loss value, and the third weight of the target slot loss value can be preset values or calculated values.
[0121] As an example, we can preset the first weight of the intent loss value, the second weight of the slot loss value, and the third weight of the target loss value to be 1 / 3. Then the total loss value of the model = 1 / 3 (intent loss value + slot loss value + target slot loss value).
[0122] As another example, statistical analysis can be performed through a large number of experiments to obtain the first weight of the intent loss value, the second weight of the slot loss value, and the third weight of the target slot loss value. Based on the calculated first, second, and third weights, as well as the intent loss value, slot loss value, and target slot loss value, a weighted calculation is performed to obtain the total loss value of the model.
[0123] According to the training method of the intent slot recognition model in this application, the intent loss value, slot loss value, and target slot loss value are obtained respectively from the intent label, intent prediction result, slot prediction result, and target slot prediction result of the training samples. The total model loss value is then obtained based on these values. In other words, the total model loss value of this training method includes not only the intent loss value and slot loss value, but also the target slot loss value, i.e., the slot prediction loss value for characters related to business interest. This improves the accuracy of the trained intent slot recognition model in predicting slots for characters related to business interest, and further enhances the model's training effect.
[0124] The process of obtaining the first weight, the second weight, and the third weight in the above embodiments will be described next.
[0125] Figure 3This is a flowchart illustrating the process of obtaining the first weight, second weight, and third weight in embodiments of this application. In some embodiments of this application, a training preparation phase may be included before training the initial intent slot recognition model. This training preparation phase includes three training processes, through which the first weight of the intent loss value, the second weight of the slot loss value, and the third weight of the target slot loss value can be obtained respectively. Figure 3 As shown, the first weight of the intent loss value can be obtained in the following way:
[0126] Step 301: Divide the training samples into N batches; where N is an integer greater than 1.
[0127] Step 302: Input the i-th batch of samples into the (i-1)-th intention optimization intention slot recognition model to obtain the i-th intention prediction result of the i-th batch of samples; where i is a positive integer less than or equal to N; when i=1, the (i-1)-th intention optimization intention slot recognition model is the initial slot recognition model.
[0128] Step 303: Based on the intent label of the i-th batch sample and the i-th intent prediction result, obtain the i-th intent loss value and add the i-th intent loss value to the intent loss value sequence.
[0129] The initial intent loss value sequence is an empty sequence. As the training process progresses, the intent loss value corresponding to each batch of samples is added to this sequence.
[0130] Step 304: Train the intent slot recognition model after the (i-1)th intent optimization based on the i-th intent loss value to obtain the intent slot recognition model after the i-th intent optimization.
[0131] In other words, the loss value of the i-th intent is used as the total loss value of the model to train the intent slot recognition model after the (i-1)-th intent optimization, so as to continue to adjust the parameters of the model and obtain the intent slot recognition model after the i-th intent optimization with adjusted parameters.
[0132] Step 305: After obtaining the intent slot recognition model after the Nth intent optimization, the N intent loss values in the intent loss value sequence are averaged to obtain the first average value.
[0133] Step 306: Calculate and process the first average value to obtain the first weight.
[0134] In some embodiments of this application, the first average value can be processed according to preset rules to obtain the first weight. As an example, if the first average value is A, 1 / A can be used as the first weight.
[0135] In some embodiments of this application, the second weight of the slot loss value can be obtained in the following way:
[0136] Step 307: Divide the training samples into N batches; where N is an integer greater than 1.
[0137] It should be noted that step 307 is implemented in the same way as step 301. In the embodiments of this application, the batch sample division can be performed at the beginning of each training process, or the N batch samples divided can be cached after step 301 is executed. That is, there is no need to execute step 307 again, and the N batch samples divided can be directly obtained from the cache.
[0138] Step 308: Input the j-th sample into the (j-1)-th slot optimization intention slot recognition model to obtain the j-th slot prediction result of the j-th batch of samples; where j is a positive integer less than or equal to N; when j=1, the (j-1)-th slot optimization intention slot recognition model is the initial slot recognition model.
[0139] Step 309: Based on the slot label of the j-th batch sample and the prediction result of the j-th slot, obtain the loss value of the j-th slot and add the loss value of the j-th slot to the slot loss value sequence.
[0140] The initial slot loss value sequence is an empty sequence. As the training process progresses, the slot loss value corresponding to each batch of samples is added to this sequence.
[0141] Step 310: Train the intent slot recognition model after slot optimization for slot j-1 based on the loss value of slot j to obtain the intent slot recognition model after slot optimization for slot j.
[0142] Step 311: After obtaining the intention slot recognition model after the Nth slot optimization, the N slot loss values in the slot loss value sequence are averaged to obtain the second average value.
[0143] Step 312: Calculate the second average value to obtain the second weight.
[0144] In some embodiments of this application, the second average value can be processed according to preset rules to obtain the second weight. As an example, if the second average value is B, 1 / B can be used as the second weight.
[0145] In addition, such as Figure 3 As shown, the third weight can be obtained in the following way:
[0146] Step 313: Divide the training samples into N batches; where N is an integer greater than 1.
[0147] It should be noted that the implementation of step 313 is the same as that of steps 307 and 301. In the embodiments of this application, the batch sample division can be performed at the beginning of each training process, or the N batch samples can be cached after step 301 is executed. That is, there is no need to execute step 313 again, and the N batch samples can be directly obtained from the cache.
[0148] Step 314: Input the m-th sample into the intention slot recognition model after the (m-1)-th target slot optimization, obtain the m-th slot prediction result of the m-th batch of samples, and obtain the m-th target slot prediction result from the m-th slot prediction result based on the labeled data of the m-th batch of samples; where m is a positive integer less than or equal to N; when m=1, the intention slot recognition model after the (m-1)-th target slot optimization is the initial slot recognition model.
[0149] In some embodiments of this application, the prediction result of the m-th target slot refers to the prediction result of the slot of the relevant character in the m-th batch of samples.
[0150] Step 315: Based on the target slot label of the m-th batch sample and the prediction result of the m-th target slot, obtain the loss value of the m-th target slot and add the loss value of the m-th target slot to the target slot loss value sequence.
[0151] Here, the target slot label of the m-th batch of samples refers to the slot label of the character related to business interest in the m-th batch of samples. The initial target slot loss value sequence is an empty sequence. As the training process progresses, the target slot loss value corresponding to each batch of samples is added to this sequence.
[0152] Step 316: Train the intention slot recognition model after the (m-1)th target slot optimization based on the m-th target slot loss value to obtain the intention slot recognition model after the m-th target slot optimization.
[0153] Step 317: After obtaining the intention slot recognition model after the Nth target slot optimization, the N target slot loss values in the target slot loss value sequence are averaged to obtain the third average value.
[0154] Step 318: Calculate the third average value to obtain the third weight.
[0155] In some embodiments of this application, the third average value can be calculated according to preset rules to obtain a third weight. As an example, if the third average value is C, 1 / C can be used as the second weight.
[0156] The training method for the intent slot recognition model according to embodiments of this application can train an initial intent recognition model using intent loss values obtained from each batch of samples, and determine a first weight based on the average of the intent loss values corresponding to each batch of samples. Alternatively, the initial intent recognition model can be trained using slot loss values obtained from each batch of samples, and a second weight can be determined based on the average of the slot loss values corresponding to each batch of samples. Furthermore, the initial intent recognition model can be trained using target slot loss values obtained from each batch of samples, and a third weight can be determined based on the average of the target slot loss values corresponding to each batch of samples. This scheme's method for calculating the total model loss value can simultaneously optimize multiple tasks such as intent prediction, slot prediction, and target slot prediction, thereby improving the model's training performance.
[0157] To implement the above embodiments, this application provides a training device for an intent slot recognition model.
[0158] Figure 4 This is a structural block diagram of a training device for an intent slot recognition model provided in an embodiment of this application. (See diagram below.) Figure 4 As shown, the device includes:
[0159] The first acquisition module 410 is used to input training samples into the initial intent slot recognition model to obtain the intent prediction result and slot prediction result corresponding to the training samples.
[0160] The second acquisition module 420 is used to obtain the target slot prediction result from the slot prediction result based on the labeled data of the training samples; the target slot prediction result is the slot prediction result of the characters related to business interest in the training samples.
[0161] The third acquisition module 430 is used to compare and calculate the total loss value of the model by comparing the intention prediction result, slot prediction result and target slot prediction result with the labeled data of the training samples respectively.
[0162] Training module 440 is used to train the initial intent slot recognition model based on the total loss value of the model, so as to obtain the trained intent slot recognition model.
[0163] In some embodiments of this application, the labeled data of the training samples includes the intent labels and slot labels of the training samples; the third acquisition module 430 includes:
[0164] The first acquisition unit 431 is used to compare and calculate the intent label and intent prediction result of the training sample to obtain the intent loss value;
[0165] The second acquisition unit 432 is used to compare and calculate the slot labels and slot prediction results of the training samples to obtain the slot loss value.
[0166] The third acquisition unit 433 is used to acquire the target slot label from the slot labels of the training sample; the target slot label is the slot label of the character related to the business interest in the training sample.
[0167] The fourth acquisition unit 434 is used to compare and calculate the target slot label and the target slot prediction result to obtain the target slot loss value;
[0168] The fifth acquisition unit 435 is used to perform calculations based on the intention loss value, slot loss value and target slot loss value to obtain the total model loss value.
[0169] Specifically, the fifth acquisition unit 435 is used for:
[0170] The total model loss value is obtained by weighting the intention loss value, the first weight of the intention loss value, the slot loss value, the second weight of the slot loss value, the target slot loss value, and the third weight of the target slot loss value.
[0171] In some embodiments of this application, the apparatus further includes a fourth acquisition module 450, which is specifically used for:
[0172] The training samples are divided into N batches; where N is an integer greater than 1.
[0173] Input the i-th batch of samples into the (i-1)-th intention optimization intention slot recognition model to obtain the i-th intention prediction result of the i-th batch of samples; where i is a positive integer less than or equal to N; when i=1, the (i-1)-th intention optimization intention slot recognition model is the initial slot recognition model;
[0174] Based on the intent label of the i-th batch sample and the i-th intent prediction result, obtain the i-th intent loss value and add the i-th intent loss value to the intent loss value sequence;
[0175] The intention slot recognition model after the (i-1)th intention optimization is trained based on the i-th intention loss value to obtain the i-th intention slot recognition model.
[0176] After obtaining the intent slot recognition model after the Nth intent optimization, the N intent loss values in the intent loss value sequence are averaged to obtain the first average value.
[0177] The first average value is processed to obtain the first weight.
[0178] In some embodiments of this application, the apparatus further includes a fifth acquisition module 460, which is specifically used for:
[0179] The training samples are divided into N batches; where N is an integer greater than 1.
[0180] The j-th sample is input into the (j-1)-th slot optimization intention slot recognition model to obtain the j-th slot prediction result of the j-th batch of samples; where j is a positive integer less than or equal to N; when j=1, the (j-1)-th slot optimization intention slot recognition model is the initial slot recognition model;
[0181] Based on the slot label and the prediction result of the j-th slot of the j-th batch of samples, obtain the loss value of the j-th slot and add the loss value of the j-th slot to the slot loss value sequence;
[0182] The intention slot recognition model after slot optimization (j-1) is trained based on the loss value of slot j to obtain the intention slot recognition model after slot optimization (j-1).
[0183] After obtaining the intent slot recognition model after the Nth slot optimization, the N slot loss values in the slot loss value sequence are averaged to obtain the second average value.
[0184] The second average value is processed to obtain the second weight.
[0185] In some embodiments of this application, the apparatus further includes a sixth acquisition module 470, which is specifically used for:
[0186] The training samples are divided into N batches; where N is an integer greater than 1.
[0187] The m-th sample is input into the (m-1)-th optimized target slot intention recognition model to obtain the m-th slot prediction result of the m-th batch of samples. Based on the labeled data of the m-th batch of samples, the m-th target slot prediction result is obtained from the m-th slot prediction result. Here, m is a positive integer less than or equal to N. When m=1, the (m-1)-th optimized target slot intention recognition model is the initial slot recognition model.
[0188] Based on the target slot label and the prediction result of the mth target slot of the mth batch sample, obtain the loss value of the mth target slot and add the loss value of the mth target slot to the target slot loss value sequence;
[0189] The intention slot recognition model after the (m-1)th target slot optimization is trained based on the loss value of the m-th target slot to obtain the intention slot recognition model after the m-th target slot optimization.
[0190] After obtaining the intent slot recognition model after the Nth optimization of the target slot, the N target slot loss values in the target slot loss value sequence are averaged to obtain the third average value;
[0191] The third average value is processed to obtain the third weight.
[0192] The training apparatus for the intent slot recognition model according to an embodiment of this application obtains intent prediction results and slot prediction results corresponding to the training samples by inputting training samples into an initial intent slot recognition model. It then extracts target slot prediction results for characters relevant to business interests from the slot prediction results. Based on the intent prediction results, slot prediction results, target slot prediction results, and labeled data of the training samples, it obtains the total model loss value. Based on this total model loss value, the initial intent slot recognition model is trained to obtain a trained intent slot recognition model. In this scheme, the slot prediction results for characters relevant to business interests are combined when calculating the total model loss value, thereby improving the slot recognition performance of the trained intent slot recognition model for characters relevant to business interests, and thus effectively improving the slot recognition accuracy of the trained intent slot recognition model.
[0193] According to embodiments of this application, this application also provides an electronic device and a computer-readable storage medium.
[0194] Figure 5 This is a structural block diagram of an electronic device for a training method of an intent slot recognition model according to embodiments of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, in-vehicle smart devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0195] like Figure 5As shown, the electronic device includes one or more processors 501, a memory 502, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 501 as an example.
[0196] The memory 502 is the non-transitory computer-readable storage medium provided in this application. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the method provided in this application. The non-transitory computer-readable storage medium of this application stores computer instructions for causing a computer to perform the method provided in this application. The computer program product of this application includes a computer program that, when executed by processor 501, implements the method provided in this application.
[0197] The memory 502, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the embodiments of this application. The processor 501 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions, and modules stored in the memory 502, thereby implementing the methods in the above-described method embodiments.
[0198] Memory 502 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the use of the electronic device according to the described method. Furthermore, memory 502 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 502 may optionally include memory remotely located relative to processor 501, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0199] The electronic device used to implement the training method for the intent slot recognition model may further include an input device 503 and an output device 504. The processor 501, memory 502, input device 503, and output device 504 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0200] Input device 503 can receive input digital or character information, and generate key signal inputs related to user settings and function control of the electronic device used to implement the above methods, such as touch screens, keypads, mice, trackpads, touchpads, joysticks, one or more mouse buttons, trackballs, joysticks, etc. Output device 504 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The display device may include, but is not limited to, liquid crystal displays (LCDs), light-emitting diode (LED) displays, and plasma displays. In some embodiments, the display device may be a touch screen.
[0201] In an exemplary embodiment, this application also provides a vehicle that includes the electronic devices described in the above embodiments.
[0202] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application-specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0203] These computational programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term “machine-readable signal” refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0204] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0205] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0206] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0207] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0208] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A training method for an intent slot recognition model, characterized in that, include: The training samples are input into the initial intent slot recognition model to obtain the intent prediction results and slot prediction results corresponding to the training samples. Based on the labeled data of the training samples, the target slot prediction result is obtained from the slot prediction result; The target slot prediction result is the slot prediction result of the characters related to business interest in the training sample. The intent prediction result, the slot prediction result, and the target slot prediction result are compared and calculated with the labeled data of the training samples to obtain the intent loss value, slot loss value, and target slot loss value. Based on the intent loss value, slot loss value, and target slot loss value, the total model loss value is obtained. The target slot loss value is the loss value obtained by comparing and calculating the target slot label and the target slot prediction result. The target slot label is the slot label of the characters related to business interest in the training samples. Based on the total loss value of the model, the initial intent slot recognition model is trained to obtain a trained intent slot recognition model.
2. The method according to claim 1, characterized in that, The labeled data of the training samples includes the intent labels and slot labels of the training samples; the intention prediction result, the slot prediction result, and the target slot prediction result are compared and calculated with the labeled data of the training samples to obtain the intent loss value, the slot loss value, and the target slot loss value; based on the intent loss value, the slot loss value, and the target slot loss value, the total model loss value is obtained, including: The intent label of the training sample and the intent prediction result are compared and calculated to obtain the intent loss value; The slot label of the training sample and the slot prediction result are compared and calculated to obtain the slot loss value; Obtain the target slot label from the slot labels of the training samples; The target slot label and the target slot prediction result are compared and calculated to obtain the target slot loss value; The model's total loss value is obtained by performing calculations based on the intention loss value, the slot loss value, and the target slot loss value.
3. The method according to claim 2, characterized in that, The step of performing calculations based on the intent loss value, the slot loss value, and the target slot loss value to obtain the total model loss value includes: The total loss value of the model is obtained by weighting the intention loss value, the first weight of the intention loss value, the slot loss value, the second weight of the slot loss value, the target slot loss value, and the third weight of the target slot loss value.
4. The method according to claim 3, characterized in that, The first weight is obtained in the following way: The training samples are divided into N batches; where N is an integer greater than 1. The i-th batch of samples is input into the (i-1)-th intention optimization intention slot recognition model to obtain the i-th intention prediction result of the i-th batch of samples; where i is a positive integer less than or equal to N; when i=1, the (i-1)-th intention optimization intention slot recognition model is the initial intention slot recognition model; Based on the intent label of the i-th batch sample and the i-th intent prediction result, the i-th intent loss value is obtained and added to the intent loss value sequence; Based on the i-th intention loss value, the intention slot recognition model after the i-1th intention optimization is trained to obtain the intention slot recognition model after the i-th intention optimization. After obtaining the intent slot recognition model after the Nth intent optimization, the N intent loss values in the intent loss value sequence are averaged to obtain the first average value; The first average value is processed to obtain the first weight.
5. The method according to claim 3, characterized in that, The second weight is obtained in the following way: The training samples are divided into N batches; where N is an integer greater than 1. The j-th batch of samples is input into the (j-1)-th optimized intention slot recognition model to obtain the j-th slot prediction result of the j-th batch of samples; wherein, j is a positive integer less than or equal to N; when j=1, the (j-1)-th optimized intention slot recognition model is the initial intention slot recognition model; Based on the slot label of the j-th batch of samples and the prediction result of the j-th slot, the loss value of the j-th slot is obtained and added to the slot loss value sequence; The intention slot recognition model after the (j-1)th slot optimization is trained based on the j-th slot loss value to obtain the j-th slot optimization intention slot recognition model. After obtaining the intention slot recognition model after the Nth slot optimization, the N slot loss values in the slot loss value sequence are averaged to obtain the second average value. The second average value is processed to obtain the second weight.
6. The method according to claim 3, characterized in that, The third weight is obtained in the following way: The training samples are divided into N batches; where N is an integer greater than 1. The m-th batch of samples is input into the (m-1)-th optimized target slot intention recognition model to obtain the m-th slot prediction result of the m-th batch of samples. Based on the labeled data of the m-th batch of samples, the m-th target slot prediction result is obtained from the m-th slot prediction result. Wherein, m is a positive integer less than or equal to N. When m=1, the (m-1)-th optimized target slot intention recognition model is the initial intention slot recognition model. Based on the target slot label of the mth batch sample and the prediction result of the mth target slot, obtain the loss value of the mth target slot and add the loss value of the mth target slot to the target slot loss value sequence; The intention slot recognition model after the (m-1)th target slot optimization is trained based on the loss value of the m-th target slot to obtain the intention slot recognition model after the m-th target slot optimization. After obtaining the intention slot recognition model after the Nth optimization of the target slot, the N target slot loss values in the target slot loss value sequence are averaged to obtain the third average value. The third average value is processed to obtain the third weight.
7. A training device for an intention slot recognition model, characterized in that, include: The first acquisition module is used to input training samples into the initial intent slot recognition model to obtain the intent prediction result and slot prediction result corresponding to the training samples; The second acquisition module is used to acquire the target slot prediction result from the slot prediction result based on the labeled data of the training samples. The target slot prediction result is the slot prediction result of the characters related to business interest in the training sample. The third acquisition module is used to compare and calculate the intent prediction result, the slot prediction result, and the target slot prediction result with the labeled data of the training samples, respectively, to obtain the intent loss value, the slot loss value, and the target slot loss value. Based on the intent loss value, the slot loss value, and the target slot loss value, the total model loss value is obtained. The target slot loss value is the loss value obtained by comparing and calculating the target slot label and the target slot prediction result. The target slot label is the slot label of the characters related to business interest in the training samples. The training module is used to train the initial intent slot recognition model based on the total loss value of the model, so as to obtain a trained intent slot recognition model.
8. The apparatus according to claim 7, characterized in that, The labeled data of the training samples includes the intent labels and slot labels of the training samples; the third acquisition module includes: The first acquisition unit is used to compare and calculate the intent label of the training sample with the intent prediction result to obtain the intent loss value; The second acquisition unit is used to compare and calculate the slot label of the training sample with the slot prediction result to obtain the slot loss value. The third acquisition unit is used to acquire the target slot label from the slot labels of the training samples; The fourth acquisition unit is used to compare and calculate the target slot label and the target slot prediction result to obtain the target slot loss value; The fifth acquisition unit is used to perform calculations based on the intention loss value, the slot loss value, and the target slot loss value to obtain the total model loss value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 6.
11. A vehicle, characterized in that, The vehicle includes the electronic equipment as described in claim 9.