Intention recognition method, intention recognition model training method, system and device

By employing online hot updates and weight adjustments, the problem of low update efficiency in existing intent recognition models is solved, achieving efficient and accurate intent recognition.

CN116049395BActive Publication Date: 2025-12-30IFLYTEK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211667309.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2025-12-30
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

Existing intent recognition models are fixed and require offline updates, resulting in low recognition efficiency and difficulty in adapting to changing scenario requirements.

Method used

Online hot updates are performed based on the updated first intent recognition model, and a second intent recognition model with the same model structure is used for training. Parameters are adjusted to improve recognition accuracy, and higher weight coefficients are set for return samples with low confidence during training to achieve efficient model updates.

Benefits of technology

It improves the accuracy and efficiency of intent recognition, saves the cost of acquiring training data, and ensures that the model still has good recognition performance when faced with complex data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116049395B_ABST
    Figure CN116049395B_ABST
Patent Text Reader

Abstract

The application discloses an intention recognition method, an intention recognition model training method, a system and a device. The method comprises the following steps: obtaining a predicted intention of to-be-recognized data based on an updated first intention recognition model; wherein the parameters in the updated first intention recognition model are consistent with the corresponding parameters in a trained second intention recognition model; the process of training the second intention recognition model comprises the following steps: obtaining a sample label and a confidence of the sample label of each backflow sample based on an initial second intention recognition model; obtaining the similarity between each backflow sample and the remaining backflow samples, and obtaining a first loss based on the similarity; determining a weight coefficient based on the confidence of the sample label of each backflow sample, obtaining a first total loss based on the first loss of all backflow samples and the weight coefficient; and adjusting the parameters of the second intention recognition model based on the first total loss. In the foregoing manner, the application can improve the accuracy of intention recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to an intent recognition method, an intent recognition model training method, a system, and an apparatus. Background Technology

[0002] With the rapid development of artificial intelligence technology, intent recognition technology is increasingly needed in various scenarios. Conventional intent recognition methods involve pre-building an intent recognition model containing a database, which then predicts the intent category of the data to be processed based on the similarity between the data to be processed and the data in the database. Furthermore, in practical applications, factors such as changing scenarios necessitate periodic updates to the intent recognition model. However, because current intent recognition models are relatively fixed and require offline updates, their efficiency is low. Summary of the Invention

[0003] The main technical problem addressed by this application is to provide an intent recognition method, intent recognition model training method, system, and apparatus that can improve the accuracy of intent recognition.

[0004] To address the aforementioned technical problems, this application provides a technical solution: an intent recognition method, comprising: obtaining a predicted intent of data to be recognized based on an updated first intent recognition model; wherein the parameters in the updated first intent recognition model are consistent with the corresponding parameters in the trained second intent recognition model, and the process of training the second intent recognition model includes: obtaining a sample label and a confidence level of the sample label for each returned sample based on an initial second intent recognition model; wherein the parameters in the initial second intent recognition model are consistent with the corresponding parameters in the first intent recognition model before the update; obtaining the similarity between each returned sample and the remaining returned samples, and obtaining a corresponding first loss based on the similarity; determining a corresponding weight coefficient based on the confidence level of the sample label of each returned sample, and obtaining a first total loss based on the first loss of all returned samples and the corresponding weight coefficients; and adjusting the parameters of the second intent recognition model based on the first total loss.

[0005] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a training method for an intent recognition model, comprising: obtaining a sample label and a confidence level of the sample label for each returned sample based on an initial second intent recognition model; wherein the parameters in the initial second intent recognition model are consistent with the corresponding parameters in the first intent recognition model before the update; obtaining the similarity between each returned sample and the remaining returned samples, and obtaining a corresponding first loss based on the similarity; determining a corresponding weight coefficient based on the confidence level of the sample label of each returned sample, and obtaining a first total loss based on the first loss of all returned samples and the corresponding weight coefficients; and adjusting the parameters of the second intent recognition model based on the first total loss.

[0006] To address the aforementioned technical problems, another technical solution adopted in this application is: providing an intent recognition system, comprising: an acquisition module, used to acquire the predicted intent of the data to be recognized based on an updated first intent recognition model; wherein the parameters in the updated first intent recognition model are consistent with the corresponding parameters in the trained second intent recognition model; and a training module, used to train the second intent recognition model; wherein the process of training the second intent recognition model includes: acquiring the sample label and the confidence level of the sample label for each returned sample based on an initial second intent recognition model; wherein the parameters in the initial second intent recognition model are consistent with the corresponding parameters in the first intent recognition model before the update; acquiring the similarity between each returned sample and the remaining returned samples, and acquiring a corresponding first loss based on the similarity; determining a corresponding weight coefficient based on the confidence level of the sample label of each returned sample, and acquiring a first total loss based on the first loss of all returned samples and the corresponding weight coefficients; and adjusting the parameters of the second intent recognition model based on the first total loss.

[0007] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide an electronic device, including a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the intent recognition method mentioned in the above technical solution.

[0008] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a computer-readable storage medium storing program instructions thereon, wherein the program instructions, when executed by a processor, implement the intent recognition method mentioned in the above technical solution.

[0009] The beneficial effects of this application are as follows: Unlike existing technologies, the intent recognition method proposed in this application improves the accuracy of intent category prediction by utilizing an updated first intent recognition model. Specifically, before updating the first intent recognition model, a second intent recognition model with the same model structure is trained using multiple return samples obtained based on the first intent recognition model, thus saving the cost of obtaining training data. Furthermore, during training, return samples with lower confidence are assigned relatively higher weight coefficients, ensuring that the trained second intent recognition model still exhibits good intent recognition performance even with complex data to be recognized. In addition, by directly adjusting the parameters in the first intent recognition model using the parameters in the second intent recognition model, the first intent recognition model can be updated without offline operation, greatly improving the efficiency of intent recognition model updates. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0011] Figure 1 This is a flowchart illustrating one embodiment of the intent recognition method of this application;

[0012] Figure 2 This is a structural diagram of one implementation of the first intent recognition model;

[0013] Figure 3 This is a flowchart illustrating one implementation method of training the second intent recognition model in step S101.

[0014] Figure 4 This is a flowchart illustrating an implementation method following step S204;

[0015] Figure 5 This is a flowchart of an implementation method following step S304;

[0016] Figure 6 This is a schematic diagram of one embodiment of the intent recognition system of this application;

[0017] Figure 7 This is a schematic diagram of the structure of one embodiment of the electronic device of this application;

[0018] Figure 8 This is a schematic diagram of one embodiment of the storage device of this application. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0020] Please see Figure 1 , Figure 1 This is a flowchart illustrating one embodiment of the intent recognition method of this application. The intent recognition method includes:

[0021] S101: Obtain the data to be identified.

[0022] In one embodiment, step S101 includes: obtaining the data to be identified for intent prediction. This data may be generated based on the dialogue between a customer and customer service representative in scenarios such as customer service Q&A or business processing.

[0023] In a specific implementation scenario, in response to the dialogue between the customer and customer service, which is in the form of audio information, the audio information is processed to generate corresponding text information, and this text information is used as the data to be identified.

[0024] S102: Obtain the predicted intent of the data to be identified based on the updated first intent recognition model.

[0025] In one implementation, due to differences in language habits among different users and changes in application scenarios in actual applications, the recognition accuracy of the first intent recognition model is prone to decline during use. Therefore, it is necessary to update the first intent recognition model in a timely manner to ensure the accuracy of intent recognition.

[0026] Specifically, the first intent recognition model is updated online based on the trained second intent prediction model. That is, a second intent recognition model with the same model structure as the first intent recognition model is pre-trained, and then the parameters in the updated first intent recognition model are made consistent with the corresponding parameters in the trained second intent recognition model.

[0027] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of one embodiment of the first intent recognition model. The updated first intent recognition model includes an updated compilation network 10 and an updated parsing network 20. The updated compilation network 10 is used to compile data samples of different intent categories to obtain semantic vectors corresponding to each data sample, and classify each data sample and its corresponding semantic vector according to the corresponding intent category to form a target database.

[0028] Furthermore, the data to be identified is input into the updated first intent recognition model, and the semantic extraction subnetwork in parsing network 20 extracts semantic features from the data to be identified to obtain the semantic vector of the data to be identified. The aforementioned semantic extraction subnetwork can be a BERT network, etc.

[0029] Furthermore, the semantic vector of the data to be identified is compared with the semantic vectors of the data samples in the target database to obtain the similarity between the data to be identified and each data sample. The highest similarity value is obtained from multiple similarity values ​​corresponding to the vector to be identified, and this highest similarity value is compared with a preset threshold. If the highest similarity value is greater than or equal to the preset threshold, the intent category of the data sample corresponding to the highest similarity value is taken as the predicted intent of the data to be identified; or, if the highest similarity value is less than the preset threshold, the corresponding data to be identified is considered unidentifiable and assigned an undetermined label.

[0030] Alternatively, the aforementioned similarity can be obtained by calculating the cosine distance or Euclidean distance between vectors.

[0031] The intent recognition method proposed in this application improves prediction accuracy by utilizing an updated first intent recognition model for intent category prediction. Specifically, before updating the first intent recognition model, a second intent recognition model with the same model structure is trained using multiple reflow samples obtained based on the first intent recognition model, saving the cost of obtaining training data. Furthermore, during training, reflow samples with low confidence are assigned relatively high weight coefficients, ensuring that the trained second intent recognition model maintains good intent recognition performance even with complex data. Additionally, parameters in the first intent recognition model are directly adjusted using parameters from the second intent recognition model, allowing for updates to the first intent recognition model without offline operation, significantly improving the efficiency of intent recognition model updates.

[0032] The training process of the second intent recognition model described above is explained in detail below. Please refer to [link / reference]. Figure 3 , Figure 3 This is a flowchart illustrating an implementation method for training the second intent recognition model in step S101. The training process includes:

[0033] S201: Obtain the sample label and confidence score of each returned sample based on the initial second intent recognition model. The parameters in the initial second intent recognition model are consistent with the corresponding parameters in the first intent recognition model before the update.

[0034] In one embodiment, step S201 includes: In practical applications, the current first intent recognition model processes the input data to be recognized to generate a large amount of historical data containing sample labels and the confidence levels of the sample labels. The sample labels include the intent categories corresponding to the historical data, and the higher the confidence level of the sample labels, the greater the probability that the corresponding historical data belongs to the corresponding intent category. Furthermore, the aforementioned current first intent recognition model is the first intent recognition model before the update.

[0035] Furthermore, a second intent recognition model is constructed, the model structure of which is identical to that of the first intent recognition model, and the parameters in the initial second intent recognition model are consistent with the corresponding parameters in the first intent recognition model before the update. Since training the constructed initial second intent recognition model requires a large amount of training data, at least a portion of the aforementioned large amount of historical data is used as reflow samples to train the second intent recognition model, saving the cost of acquiring training data.

[0036] Specifically, in response to the second intent recognition model containing the same initial database as the first intent recognition model before the update, and this initial database including multiple data samples, multiple retrieved samples are input into the second intent recognition model to obtain semantic vectors corresponding to the retrieved samples. Based on the retrieved samples and the semantic vectors corresponding to the multiple data samples, the similarity between the retrieved samples and the data samples under each intent category in the initial database is obtained, and the highest similarity score is taken as the confidence score corresponding to the retrieved sample. The specific process can be referred to the corresponding implementation method described above.

[0037] Furthermore, the confidence level of each returned sample is compared with a second threshold. If the confidence level of the returned sample is greater than or equal to the second threshold, the intent category of the data sample corresponding to the confidence level is used as the sample label of the returned sample; or, if the confidence level is less than the second threshold, an undetermined label is used as the sample label of the corresponding returned sample.

[0038] The second threshold mentioned above is the same as the preset threshold mentioned in step S101, and its specific value is between 0 and 1. In this embodiment, the second threshold is set to 0.6. Of course, in other embodiments, the second threshold may also be other values ​​estimated by relevant technical personnel or obtained by back-calculation through multiple experiments.

[0039] Unlike the approach of directly using the intent category of the data sample corresponding to the confidence level as the sample label of the corresponding return sample, this implementation reduces the probability of incorrect intent category prediction by assigning undetermined labels to return samples with a confidence level less than the second threshold. This results in better intent recognition performance of the second intent recognition model trained using return samples.

[0040] Alternatively, in other implementations, historical data with relatively low confidence can be selected from the large amount of historical data generated by the current first intent recognition model as feedback samples, so that during the training process, the second intent recognition model can focus on learning to recognize samples that are more difficult to identify.

[0041] S202: Obtain the similarity between each re-flow sample and the remaining re-flow samples, and obtain the corresponding first loss based on the similarity.

[0042] In one embodiment, step S202 includes: in response to the multiple reflux samples and corresponding sample labels obtained through step S201 above, randomly obtaining a first type of sample with the same sample label as the current reflux sample, and a second type of sample with a different sample label than the current sample.

[0043] Specifically, the current reflux sample is randomly selected from multiple reflux samples. Based on the sample label A corresponding to the current reflux sample, a reflux sample is randomly selected from the remaining reflux samples with the sample label A as the first type of sample, and a reflux sample with other sample labels B is randomly selected as the second type of sample.

[0044] Furthermore, the current reflow sample, the first type of sample, and the second type of sample are input into the second intent recognition model to obtain the semantic vectors corresponding to the reflow sample, the first type of sample, and the second type of sample, respectively. By calculating the similarity between the vectors, the first similarity between the current reflow sample and the first type of sample, and the second similarity between the current reflow sample and the second type of sample are obtained.

[0045] Alternatively, the similarity between vectors can be obtained by calculating cosine distance or Euclidean distance, etc.

[0046] Furthermore, the obtained first similarity is subtracted from the second similarity to obtain a first difference between the first and second similarities, and a corresponding first loss is obtained based on the first difference. The first loss is greater than or equal to 0, and the first loss is negatively correlated with the first difference.

[0047] In one specific implementation, a first threshold is set, and a second difference is obtained between the first threshold and the aforementioned first difference. If the second difference is greater than 0, the second difference is used as a first loss; or, if the second difference is less than or equal to 0, the first loss is set to 0. The specific calculation formula is as follows:

[0048] L(q) = max[0, M - cos(qq)] + )-os(qq - )]

[0049] Where q represents the current reflux sample, L(q) represents the first loss, and q+ Let q represent the first type of sample. - Denotes the second type of sample, cos(qq) + ) represents the first similarity, cos(qq) - ) represents the second similarity; M is the first threshold, which can be 2.

[0050] Optionally, in another embodiment, the process of obtaining the first type of sample and the second type of sample in step S203 may also include: according to the sample label A corresponding to the current reflux sample, taking the reflux sample with the highest confidence among the remaining reflux samples with the sample label A as the first type of sample, and taking the reflux sample with the highest confidence among the reflux samples with other sample labels B as the second type of sample.

[0051] S203: Determine the corresponding weight coefficient based on the confidence level of the sample label of each returned sample, and obtain the first total loss based on the first loss of all returned samples and the corresponding weight coefficient.

[0052] In one embodiment, step S203 includes: comparing the confidence level with a second threshold to determine the weight coefficient of the corresponding return sample.

[0053] If the confidence level of the sample label of the current returned sample is greater than or equal to a second threshold, then a corresponding weight coefficient is obtained based on a preset function and the confidence level. The confidence level and the weight coefficient are negatively correlated, and the weight coefficient is greater than or equal to a first preset value; in this embodiment, the first preset value is 1. Alternatively, if the confidence level of the sample label of the current returned sample is less than the second threshold, then the weight coefficient of the current returned sample is determined to be the second preset value. In this embodiment, the second preset value is 2.

[0054] Specifically, return samples with a confidence level greater than or equal to the second threshold are designated as first return samples, and return samples with a confidence level less than the second threshold are designated as second return samples. For the first return samples, those with higher confidence levels are assigned relatively smaller weight coefficients, while those with lower confidence levels are assigned relatively larger weight coefficients. This ensures that among all return samples, those with lower confidence levels have higher weight coefficients. This helps the second intent recognition model focus on learning from return samples with relatively lower confidence levels during training, and enables the trained second intent recognition model to accurately identify the intent category corresponding to more complex or difficult-to-identify data.

[0055] In one specific embodiment, the step of obtaining the corresponding weight coefficient based on the preset function and confidence level includes: obtaining a third difference between the confidence level of the sample label of the current returned sample and one, and a fourth difference between the second threshold and one. The sum of the ratio of the third difference and the fourth difference and a third preset value is used as the weight coefficient. The third preset value is 1. That is, in this embodiment, the weight coefficient satisfies the following calculation formula:

[0056]

[0057] Where f(q) represents the weight coefficient of the current reflux sample, S(q) represents the confidence level of the sample label of the current reflux sample, and T represents the second threshold. In this embodiment, the second threshold is 0.6.

[0058] Furthermore, the first loss of all returned samples is multiplied by their corresponding weight coefficients to obtain the first product for all returned samples. The sum of all first products is used as the first total loss, which helps to adjust the parameters of the second intent recognition model based on this first total loss. The specific calculation formula is as follows:

[0059]

[0060] Where LOSS1 represents the first total loss and B represents the number of refluxed samples.

[0061] Optionally, in other embodiments, the confidence levels of the sample labels of the returned samples can be divided into multiple levels based on the aforementioned second threshold. For example, when the second threshold is 0.6, returned samples with confidence levels greater than or equal to 0.6 and less than 0.7 are labeled as the first level and assigned a first weight; returned samples with confidence levels greater than or equal to 0.7 and less than 0.9 are labeled as the second level and assigned a second weight; returned samples with confidence levels greater than or equal to 0.9 and less than or equal to 1 are labeled as the third level and assigned a third weight. Wherein, the first weight, the second weight, and the third weight are all greater than 1, and the first weight is greater than the second weight, and the second weight is greater than the third weight.

[0062] S204: Adjust the parameters of the second intent recognition model based on the first total loss.

[0063] In one embodiment, step S204 includes adjusting the parameters in the second intent recognition model based on the obtained first total loss to obtain the trained second intent recognition model. Training is stopped when the number of training iterations reaches a preset number of rounds, or when the first total loss of the second intent recognition model converges.

[0064] In this embodiment, the cost of obtaining training data is reduced by using multiple reflow samples obtained from the first intent recognition model to train the second intent recognition model. Furthermore, for reflow samples with a clear intent category, higher weight coefficients are assigned to reflow samples with lower confidence levels. This allows the second intent recognition model to focus on learning to recognize more challenging reflow samples during training, thereby improving the recognition accuracy of the trained second intent recognition model.

[0065] In another implementation, please refer to Figure 4 , Figure 4 This is a flowchart illustrating an implementation method following step S204. Specifically, after obtaining the trained second intent recognition model, the method further includes optimizing the trained second intent recognition model. This optimization process includes:

[0066] S301: Obtain the initial data sample vector corresponding to each data sample in the initial database based on the adjusted second intent recognition model. The data sample includes its corresponding data label.

[0067] In one embodiment, step S301 includes: obtaining an initial database in the current second intent recognition model. This initial database includes multiple data samples, and based on the intent category to which each data sample belongs, a data label is determined for each data sample.

[0068] Furthermore, the obtained initial database is input into the trained second intent recognition model to output the initial data sample vector corresponding to each data sample.

[0069] S302: Obtain the corresponding second loss based on the similarity between each initial data sample vector and the remaining initial data sample vectors.

[0070] In one embodiment, step S302 includes: randomly obtaining a third type of sample with the same data label as the current initial data sample, and a fourth type of sample with different data labels than the current initial data sample. A third similarity between the current initial data sample and the third type of sample, and a fourth similarity between the current initial data sample and the fourth type of sample are obtained. The specific process for obtaining the third and fourth similarities can be referred to the corresponding embodiments described above, and will not be elaborated upon here.

[0071] Furthermore, a fifth difference is obtained between the third and fourth similarities, and a corresponding second loss is derived based on this fifth difference. The specific formula for calculating the second loss is as follows:

[0072] L(p) = max[0, M - cos(pp)] + )-os(pp- )]

[0073] Where p represents the current initial data sample, L(p) represents the second loss, p + p represents the third type of sample. - Represents the fourth type of sample, cos(pp) + ) represents the third similarity, cos(pp - ) represents the fourth similarity; M is the first threshold.

[0074] S303: Obtain the second total loss based on all second losses.

[0075] In one embodiment, step S303 includes:

[0076]

[0077] Where LOSS2 represents the second total loss, and C represents the number of data samples in the initial database.

[0078] S304: Adjust the parameters of the second intent recognition model based on the second total loss.

[0079] In one embodiment, the parameters in the trained second intent recognition model are adjusted based on the obtained second total loss to optimize the trained second intent recognition model and obtain an optimized second intent recognition model.

[0080] Furthermore, after obtaining the optimized second intent recognition model, the process also includes obtaining a unique identifier for the adjusted second intent recognition model. This identifier includes the timestamp corresponding to the step of adjusting the parameters of the intent recognition model based on the second total loss.

[0081] Specifically, by combining the timestamp corresponding to the time of optimization completion with the random code, an identity identifier corresponding to the optimized second intent recognition model is generated.

[0082] Alternatively, a corresponding model number can be set for the second intent recognition model, and the identity identifier of the corresponding second intent recognition model can be generated by combining the model number and the timestamp mentioned above.

[0083] In another implementation, please refer to Figure 5 , Figure 5 This is a flowchart illustrating an embodiment following step S304. Specifically, step S304 includes:

[0084] S401: In response to receiving the first intent recognition model update instruction, update the compiled network in the first intent recognition model according to the parameters in the adjusted second intent recognition model.

[0085] In one embodiment, step S401 includes: in response to the first intent recognition model satisfying a preset update condition in actual application, obtaining an update instruction, and updating the compilation network in the first intent recognition model using the optimized second intent recognition model based on the update instruction.

[0086] Specifically, it is determined whether the first intent recognition model meets the preset update conditions. If so, a first update file is generated based on the optimized second intent recognition model. This first update file contains the relevant parameters of the compiled network in the second intent recognition model. The generated first update file is downloaded to the first intent recognition model, so that the relevant parameters of the compiled network in the first intent recognition model can be automatically adjusted online using the parameters in the first update file, which greatly improves the update efficiency.

[0087] The aforementioned preset update condition can be that the first intent recognition model has completed the recognition of a predetermined number of data; for example, when the first intent recognition model completes the intent prediction of 1 million data points, an update instruction is triggered. Alternatively, the aforementioned preset update condition can also be that the update time interval reaches a preset duration; for example, in response to the preset duration since the last update, the preset update condition is met.

[0088] In addition, during the update of the compilation network in the first intent recognition model, the update status of the compilation network is monitored in real time. If the compilation network in the first intent recognition model is successfully updated, step S402 is executed; if the update fails due to factors such as abnormal parameters or download failure, it is checked whether the number of compilation network updates meets the threshold; if the threshold is not met, step S401 is re-executed; if the threshold is met, the update of the first intent recognition model is stopped, and a signal indicating model update failure is output.

[0089] Optionally, in this embodiment, the number of times threshold can be 3, 4 or 5, etc., and can be set according to actual needs.

[0090] Alternatively, in other embodiments, the step of updating the compilation network in the first intent recognition model using the optimized second intent recognition model in step S401 can also be to directly adjust the parameters of the compilation network in the first intent recognition model using the corresponding parameters in the optimized second intent recognition model.

[0091] S402: In response to a successful compilation network update, the initial database is input into the updated compilation network to obtain the target database corresponding to the initial database. The target database includes a target data sample vector and a data label for each data sample; the target data sample vector carries an identifier.

[0092] In one embodiment, step S402 includes: after updating the compilation network in the first intent recognition model, inputting the initial database into the updated compilation network of the first intent recognition model. Then, recompiling the data samples in the initial database in conjunction with the identity identifier corresponding to the second intent recognition model to obtain the target data sample vector corresponding to each data sample.

[0093] Specifically, the updated compilation network of the first intent recognition model recompiles the data samples to obtain the semantic vectors corresponding to each data sample, and adds the identity identifier of the optimized second intent recognition model to the semantic vectors corresponding to each data sample to obtain the target data sample vectors corresponding to each data sample.

[0094] Furthermore, the target data sample vectors corresponding to all data samples are combined to form a target database. Each target data sample vector contains a corresponding data label, and the data labels corresponding to the target data sample vectors are identical to those corresponding to the initial data sample vectors.

[0095] S403: In response to the matching of the identity identifier of the second intent recognition model with the identity identifier carried by each target data sample vector, update the parsing network in the first intent recognition model using the parameters in the second intent recognition model, and load the target database into the parsing network.

[0096] In one embodiment, before step S403, the process includes: in response to the completion of the compilation network update in the first intent recognition model, generating a second update file based on the optimized second intent recognition model. This second update file contains relevant parameters of the parsing network in the second intent recognition model. The generated second update file and the target database are downloaded to the parsing network in the first intent recognition model to determine whether the identity identifier of the second intent recognition model corresponding to the second update file matches the corresponding identity identifier of each target data sample in the target database. If they match, step S403 is executed; if they do not match, the update of the first intent recognition model is stopped, an update failure signal is output, and the target database is restored to its initial state.

[0097] Furthermore, the implementation process of step S403 includes: in response to the matching of the identity identifier of the second intent recognition model with the identity identifier corresponding to each target data sample, adjusting the relevant parameters of the parsing network in the first intent recognition model using the parameters in the second update file.

[0098] The process of updating the parsing network in the first intent recognition model includes: detecting whether the parsing network has been successfully updated; if the update is successful, the first intent recognition model is updated and a message indicating successful model update is output; if the update fails, it is detected whether the number of times the parsing network has been updated meets the number threshold; if the number threshold is not met, the steps of updating the parsing network are repeated; if the number threshold is met, the update of the first intent recognition model is stopped and a signal indicating model update failure is output.

[0099] This embodiment uses a second intent recognition model and its corresponding identity identifier to update the first intent recognition model, which can prevent parameter mismatch during the update process and improve the efficiency of updating the first intent recognition model.

[0100] Please see Figure 6 , Figure 6 This is a schematic diagram of one embodiment of the intent recognition system of this application. The intent recognition system specifically includes: a prediction module 30 and a training module 40.

[0101] Specifically, the prediction module 30 is used to obtain the predicted intent of the data to be identified based on the updated first intent recognition model; wherein the parameters in the updated first intent recognition model are consistent with the corresponding parameters in the trained second intent recognition model.

[0102] Training module 40 is used to train the second intent recognition model. The process of training the second intent recognition model includes: obtaining the sample label and confidence score of each returned sample based on the initial second intent recognition model; wherein the parameters in the initial second intent recognition model are consistent with the corresponding parameters in the first intent recognition model before the update; obtaining the similarity between each returned sample and the remaining returned samples, and obtaining a corresponding first loss based on the similarity; determining the corresponding weight coefficient based on the confidence score of the sample label of each returned sample, and obtaining a first total loss based on the first loss of all returned samples and the corresponding weight coefficients; and adjusting the parameters of the second intent recognition model based on the first total loss.

[0103] The step of obtaining the corresponding first loss based on similarity includes: randomly obtaining a first type of sample with the same sample label as the current returned sample and a second type of sample with different sample labels as the current returned sample; obtaining a first similarity between the current returned sample and the first type of sample, and a second similarity between the current returned sample and the second type of sample; obtaining a first difference between the first similarity and the second similarity; and obtaining the corresponding first loss based on the first difference; wherein the first loss is greater than or equal to 0, and the first loss is negatively correlated with the first difference.

[0104] The step of obtaining the corresponding first loss based on the first difference includes: obtaining a second difference between the first threshold and the first difference; taking the second difference as the first loss in response to the second difference being greater than 0; and setting the first loss to 0 in response to the second difference being less than or equal to 0.

[0105] The step of determining the corresponding weight coefficient based on the sample label of each returned sample includes: in response to the confidence level of the sample label of the current returned sample being greater than or equal to a second threshold, obtaining the corresponding weight coefficient based on a preset function and the confidence level; wherein the confidence level is negatively correlated with the weight coefficient, and the weight coefficient is greater than or equal to a first preset value; in response to the confidence level of the sample label of the current returned sample being less than the second threshold, determining the weight coefficient of the current returned sample as the second preset value.

[0106] The step of obtaining the corresponding weight coefficients based on the preset function and confidence level includes: obtaining the third difference between the confidence level of the sample label of the current return sample and one, and the fourth difference between the second threshold and one; and using the ratio of the third difference to the fourth difference and the sum of the third preset value as the weight coefficient.

[0107] The step of obtaining the sample label and confidence level of each returned sample based on the first intent recognition model includes: inputting multiple returned samples into the first intent recognition model to obtain the similarity between the returned samples and data samples under each intent category in the initial database, and taking the largest similarity value as the confidence level corresponding to the returned sample; in response to the confidence level being greater than or equal to a second threshold, taking the intent category of the data sample corresponding to the confidence level as the sample label of the returned sample; and in response to the confidence level being less than the second threshold, taking the undetermined label as the sample label of the corresponding returned sample.

[0108] Please continue reading. Figure 6 The intent recognition system provided in this application further includes an optimization module 50, connected between the prediction module 30 and the training module 40, used to obtain an initial data sample vector corresponding to each data sample in the initial database based on the adjusted second intent recognition model after the step of adjusting the parameters of the second intent recognition model based on the first total loss; wherein, the data sample includes a corresponding data label; obtain a corresponding second loss based on the similarity between each initial data sample vector and the remaining initial data sample vectors; obtain a second total loss based on all the second losses; and adjust the parameters of the second intent recognition model based on the second total loss.

[0109] After adjusting the parameters of the second intent recognition model based on the second total loss, the process further includes: obtaining a unique identifier for the adjusted second intent recognition model; wherein the identifier includes a timestamp corresponding to the step of adjusting the parameters of the second intent recognition model based on the second total loss.

[0110] Please continue reading. Figure 6 The intent recognition system provided in this application further includes an update module 60, connected between the prediction module 30 and the optimization module 50, for use after obtaining the unique identifier of the adjusted second intent recognition model, and further including: in response to obtaining the first intent recognition model update instruction, updating the compilation network in the first intent recognition model according to the parameters in the adjusted second intent recognition model; in response to the successful update of the compilation network, inputting the initial database into the updated compilation network to obtain the target database corresponding to the initial database; wherein, the target database includes a target data sample vector and a data label corresponding to each data sample, and the target data sample vector carries the identifier; in response to the identifier corresponding to the second intent recognition model matching the identifier carried by each target data sample vector, updating the parsing network in the first intent recognition model using the parameters in the second intent recognition model, and loading the target database into the parsing network.

[0111] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an embodiment of the electronic device of this application. The electronic device includes a memory 70 and a processor 80 coupled to each other. The memory 70 stores program instructions, and the processor 80 is used to execute the program instructions to implement the methods in any of the above embodiments. Specifically, the electronic device includes, but is not limited to, desktop computers, laptops, tablets, servers, etc., and is not limited thereto. In addition, the processor 80 may also be called a CPU (Center Processing Unit). The processor 80 may be an integrated circuit chip with signal processing capabilities. The processor 80 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. In addition, the processor 80 may be implemented by integrated circuit chips.

[0112] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a storage device according to an embodiment of the present application. The storage device 90 stores program instructions 95 that can be executed by a processor. The program instructions 95 are used to implement the methods in any of the above embodiments.

[0113] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0114] The units described as separate components may or may not be physically separate. The components shown as units 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 units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0115] Furthermore, the functional units in the various embodiments of this application 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 as a software functional unit.

[0116] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0117] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. An intention recognition method, characterized by, The method comprises: obtaining a predicted intention of to-be-recognized data based on an updated first intention recognition model; wherein parameters in the updated first intention recognition model are consistent with corresponding parameters in a trained second intention recognition model, and a process of training the second intention recognition model comprises: obtaining a sample label and a confidence of the sample label of each backflow sample based on an initial second intention recognition model; wherein parameters in the initial second intention recognition model are consistent with corresponding parameters in the first intention recognition model before updating; obtaining a similarity between each backflow sample and the remaining backflow samples, and obtaining a corresponding first loss based on the similarity; determining a corresponding weight coefficient based on the confidence of the sample label of each backflow sample, and obtaining a first total loss based on the first loss of all backflow samples and the corresponding weight coefficient; adjusting parameters of the second intention recognition model based on the first total loss.

2. The method of claim 1, wherein, The step of obtaining a similarity between each backflow sample and the remaining backflow samples, and obtaining a corresponding first loss based on the similarity, comprises: randomly obtaining a first type of sample with the same sample label as the current backflow sample, and a second type of sample with a different sample label from the current backflow sample; obtaining a first similarity between the current backflow sample and the first type of sample, and a second similarity between the current backflow sample and the second type of sample; obtaining a first difference between the first similarity and the second similarity; obtaining a corresponding first loss based on the first difference; wherein the first loss is greater than 5 or equal to 0, and the first loss is negatively correlated with the first difference.

3. The method of claim 2, wherein, The step of obtaining a corresponding first loss based on the first difference comprises: obtaining a second difference between a first threshold and the first difference; in response to the second difference being greater than 0, taking the second difference as the first loss; in response to the second difference being less than or equal to 0, setting the first loss to 0.

4. The method of claim 1, wherein, The step of determining a corresponding weight coefficient based on the confidence of the sample label of each backflow sample comprises: in response to the confidence of the sample label of the current backflow sample being greater than or equal to a second threshold, obtaining a corresponding weight coefficient based on a preset function and the confidence; wherein the confidence is negatively correlated with the weight coefficient, and the weight coefficient is greater than or equal to a first preset value; in response to the confidence of the sample label of the current backflow sample being less than the second threshold, determining the weight coefficient of the current backflow sample as a second preset value.

5. The method of claim 4, wherein, The step of obtaining a corresponding weight coefficient based on a preset function and the confidence comprises: obtaining a third difference between the confidence of the sample label of the current backflow sample and one, and a fourth difference between the second threshold and one; taking a sum of a ratio of the third difference to the fourth difference and a third preset value as the weight coefficient.

6. The method of claim 1, wherein, The step of obtaining a sample label and a confidence of the sample label of each backflow sample based on the first intention recognition model comprises: inputting a plurality of the backflow samples into the first intention recognition model, obtaining similarity of the backflow samples and data samples under each intention category in an initial database, taking the maximum value of the similarity as the confidence degree corresponding to the backflow sample; in response to the confidence degree being greater than or equal to a second threshold value, taking an intention category of the data sample corresponding to the confidence degree as a sample label of the backflow sample; in response to the confidence degree being less than the second threshold value, taking a pending label as the sample label corresponding to the backflow sample.

7. The method of claim 1, wherein, after the step of adjusting the parameters of the second intention recognition model based on the second total loss, the method further comprises: obtaining an initial data sample vector corresponding to each data sample in the initial database based on the adjusted second intention recognition model; wherein the data sample comprises a corresponding data label; obtaining a corresponding second loss based on similarity between each initial data sample vector and the remaining initial data sample vectors; obtaining a second total loss based on all the second losses; adjusting the parameters of the second intention recognition model based on the second total loss.

8. The method of claim 7, wherein, after the step of adjusting the parameters of the second intention recognition model based on the second total loss, the method further comprises: obtaining a unique identity of the adjusted second intention recognition model; wherein the identity comprises a time stamp corresponding to the step of adjusting the parameters of the second intention recognition model based on the second total loss.

9. The method of claim 8, wherein, after the step of obtaining the unique identity of the adjusted second intention recognition model, the method further comprises: in response to obtaining a first intention recognition model update instruction, updating the compiling network in the first intention recognition model according to the parameters in the adjusted second intention recognition model; in response to the compiling network being successfully updated, inputting the initial database into the updated compiling network to obtain a target database corresponding to the initial database; wherein the target database comprises a target data sample vector corresponding to each data sample and the data label, and the target data sample vector carries the identity; in response to the identity corresponding to the second intention recognition model matching the identity carried by each target data sample vector, updating the parsing network in the first intention recognition model using the parameters in the second intention recognition model, and loading the target database into the parsing network. 10.A method for training an intent recognition model, the method comprising: the method comprises: obtaining a sample label and a confidence degree of the sample label of each backflow sample based on an initial second intention recognition model; wherein the parameters in the initial second intention recognition model are consistent with the corresponding parameters in the first intention recognition model before being updated; obtaining similarity between each backflow sample and the remaining backflow samples, and obtaining a corresponding first loss based on the similarity; determining a corresponding weight coefficient based on the confidence degree of the sample label of each backflow sample, and obtaining a first total loss based on the first loss of all the backflow samples and the corresponding weight coefficients; adjust parameters of the second intent recognition model based on the first total loss.

11. An intention recognition system, characterized by, The method comprises: obtaining a predicted intent of to-be-recognized data based on the updated first intent recognition model; wherein parameters in the updated first intent recognition model are consistent with corresponding parameters in the trained second intent recognition model; training the second intent recognition model; wherein the process of training the second intent recognition model comprises: obtaining a sample label and a confidence of the sample label of each backflow sample based on an initial second intent recognition model; wherein parameters in the initial second intent recognition model are consistent with corresponding parameters in the first intent recognition model before updating; obtaining a similarity between each backflow sample and the rest of the backflow samples, obtaining a corresponding first loss based on the similarity; determining a corresponding weight coefficient based on the confidence of the sample label of each backflow sample, obtaining a first total loss based on the first loss of all backflow samples and the corresponding weight coefficient; and adjusting parameters of the second intent recognition model based on the first total loss.

12. An electronic device, comprising: The method comprises: a memory and a processor coupled to each other, the memory storing program data, and the processor invoking the program data to execute the intent recognition method according to any one of claims 1-9.

13. A computer readable storage medium having stored thereon program data, wherein, The program data is executed by the processor to implement the intent recognition method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Recognition rejection method in intention recognition, electronic device and storage medium

    CN109871446A

  • New intention recognition method for screening negative samples by utilizing called guest information

    CN112417132A