Multi-intention recognition method, device, electronic device and storage medium

By pre-training the multi-intent label classification model and using the average expected loss function to adjust the number of predicted intents, the problem of complicated and incomplete multi-intent labeling is solved, automatic and accurate labeling is achieved, and labor costs are reduced.

CN116431808BActive Publication Date: 2025-09-23JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310377762.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2025-09-23
Estimated Expiration
2043-04-10

AI Technical Summary

Technical Problem

The existing technology is cumbersome and prone to incompleteness when labeling multi-intent tags, resulting in a low level of intelligence.

Method used

By pre-training the multi-intent label classification model based on the loss function and using the average expected loss function to adjust the number of predicted intents to make it close to the number of true intents, automatic and accurate multi-intent labeling can be achieved.

Benefits of technology

Automatic and accurate multi-intent labeling is achieved, which reduces labor costs and improves labeling accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116431808B_ABST
    Figure CN116431808B_ABST
Patent Text Reader

Abstract

The present disclosure provides a multi-intent recognition method, device, electronic device and storage medium, the method comprising: obtaining a unit batch of corpus to be recognized, wherein the unit batch of corpus to be recognized includes a first preset number of multi-intent corpus to be recognized, and the multi-intent corpus to be recognized includes a single intent label; inputting the unit batch of corpus to be recognized into a multi-intent label classification model to obtain a unit batch of multi-intent corpus, so that the number of intent labels of the unit batch of multi-intent corpus corresponds to the expected value of the intent label, wherein the unit batch of multi-intent corpus includes a first preset number of multi-intent corpus, the multi-intent corpus is the multi-intent corpus to be recognized after multi-intent recognition, and the multi-intent label classification model is obtained through pre-training based on a loss function, the loss function includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label. Through the present disclosure, it is achieved that multi-intent labels can be fully labeled automatically and accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of language processing technology, and in particular to a multi-intention recognition method, device, electronic device, and storage medium. Background Art

[0002] Intent recognition refers to a processing method that assigns the intent-to-be-recognized corpus to the corresponding intent category through classification technology.

[0003] Traditional intent recognition primarily focuses on single intent recognition, specifically identifying the primary intent in a sentence while ignoring other secondary intents. Consequently, it only recognizes a single intent and has a low level of intelligence. With the continuous advancement of conversational intelligence, it's no longer just about single intent recognition; it's also about recognizing multiple intents expressed in the corpus to be recognized.

[0004] Currently, when performing multi-intent identification on the corpus to be identified, manual participation in the labeling of intent labels is often required, which leads to a heavy workload when labeling multi-intent labels and is prone to incomplete labeling. Summary of the Invention

[0005] The present disclosure provides a multi-intent recognition method, device, electronic device and storage medium to solve the problems in the prior art of complicated workload and incomplete labeling when performing multi-intent labeling. It realizes automatic and accurate comprehensive labeling of multi-intent labels, reduces labor costs and improves labeling accuracy.

[0006] The present disclosure provides a multi-intent recognition method, which includes: obtaining a unit batch of corpora to be recognized, wherein the unit batch of corpora to be recognized includes a first preset number of multi-intent corpora to be recognized, and the multi-intent corpora to be recognized include a single intent label; inputting the unit batch of corpora to be recognized into a multi-intent label classification model to obtain a unit batch of multi-intent corpora output by the multi-intent label classification model, so that the number of intent labels of the unit batch of multi-intent corpora corresponds to the expected value of the intent labels, wherein the unit batch of multi-intent corpora includes a first preset number of multi-intent corpora, and the multi-intent corpora are multi-intent corpora to be recognized after multi-intent recognition, wherein the multi-intent label classification model is obtained through pre-training based on a loss function, wherein the loss function at least includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label.

[0007] According to a multi-intent recognition method provided by the present disclosure, the multi-intent label classification model is obtained through pre-training based on a loss function, specifically including: obtaining a second preset number of seed corpora, wherein the seed corpora include target intent labels, and the dialogue application scenario of the seed corpora is the same as the dialogue application scenario of the unit batch of corpora to be recognized; performing multiple rounds of iterative training on the multi-intent label classification model based on the loss function until the average expected loss function in the loss function is less than or equal to the loss value threshold, wherein the output of the multi-intent label classification model in the current round of training is used as the input of the multi-intent label classification model in the next round of training, and the second preset number of seed corpora is used as the input of the multi-intent label classification model in the first round of training.

[0008] According to a multi-intent identification method provided by the present disclosure, the seed corpus also includes additional intent labels, wherein the additional intent labels are other intent labels in addition to the target intent labels; the average expected loss function is determined in the following manner: based on the number of the target intent labels and the number of the additional intent labels, the number of intent labels of each seed corpus is determined; based on the average value of the number of intent labels of each seed corpus, the expected value of the intent label is determined; based on the expected value of the intent label and the number of predicted intent labels, the average expected loss function is determined, wherein the number of predicted intent labels is the number of intent labels included in the output of the multi-intent label classification model during each round of training.

[0009] According to a multi-intent recognition method provided by the present disclosure, the average expected loss function is determined based on the expected value of the intention label and the number of predicted intention labels, specifically including: obtaining the intention expectation parameter based on the product of the second preset number and the expected value of the intention label; and determining the average expected loss function based on the difference between the intention expectation parameter and the number of predicted intention labels.

[0010] According to a multi-intent recognition method provided by the present disclosure, a multi-intent corpus to be recognized including a single intent label is obtained in the following manner: the initial multi-intent corpus to be recognized that is not labeled with a single intent label is input into a single intent classification model, and the multi-intent corpus to be recognized labeled with a single intent label is output by the single intent classification model, wherein the single intent classification model is obtained based on pre-training of a seed corpus, and the dialogue application scenario of the seed corpus is the same as the dialogue application scenario of the multi-intent corpus to be recognized.

[0011] The present disclosure also provides a multi-intent recognition device, which includes: a first module for obtaining a unit batch of corpora to be recognized, wherein the unit batch of corpora to be recognized includes a first preset number of multi-intent corpora to be recognized, and the multi-intent corpora to be recognized include a single intent label; a second module for inputting the unit batch of corpora to be recognized into a multi-intent label classification model to obtain a unit batch of multi-intent corpora output by the multi-intent label classification model, so that the number of intent labels of the unit batch of multi-intent corpora corresponds to the expected value of the intent labels, wherein the unit batch of multi-intent corpora includes a first preset number of multi-intent corpora, and the multi-intent corpora are multi-intent corpora to be recognized after multi-intent recognition, wherein the multi-intent label classification model is obtained through pre-training based on a loss function, wherein the loss function at least includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label.

[0012] According to a multi-intent recognition device provided by the present disclosure, the second module obtains a multi-intent label classification model through pre-training based on a loss function in the following manner: obtaining a second preset number of seed corpora, wherein the seed corpora include target intent labels, and the dialogue application scenario of the seed corpora is the same as the dialogue application scenario of the unit batch of corpora to be recognized; performing multiple rounds of iterative training on the multi-intent label classification model based on the loss function until the average expected loss function in the loss function is less than or equal to the loss value threshold, wherein the output of the multi-intent label classification model in the current round of training is used as the input of the multi-intent label classification model in the next round of training, and the second preset number of seed corpora is used as the input of the multi-intent label classification model in the first round of training.

[0013] The present disclosure also provides an electronic device, 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, the multi-intent recognition method as described above is implemented.

[0014] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the multi-intent recognition methods described above.

[0015] The present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the multi-intent recognition methods described above.

[0016] The multi-intent recognition method, device, electronic device and storage medium provided by the present disclosure pre-train a multi-intent label classification model based on a loss function, wherein the loss function includes an average expected loss function, which is determined according to the expected value of the intent label. This ensures that the unit batch of corpus to be recognized is input into the multi-intent label classification model, and the unit batch of multi-intent corpus output by the multi-intent label classification model can be obtained, so that the number of intent labels of the unit batch of multi-intent corpus corresponds to the expected value of the intent label, that is, the number of intent labels of the unit batch of multi-intent corpus meets the expected number of real intent labels. This achieves automatic and accurate comprehensive labeling of multi-intent labels, thereby reducing labor costs and improving labeling accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] Figure 1 This is one of the flowcharts of the multi-intent recognition method provided by the present disclosure;

[0019] Figure 2 This is a flow chart of obtaining a multi-intent label classification model through pre-training based on a loss function provided by the present disclosure;

[0020] Figure 3 This is a schematic diagram of an application scenario of the multi-intent label classification model provided by the present disclosure;

[0021] Figure 4 is a schematic diagram of a process for determining an average expected loss function provided by the present disclosure;

[0022] Figure 5 This is a schematic diagram of an application scenario of the single intent classification model provided by the present disclosure;

[0023] Figure 6 This is the second flowchart of the multi-intent recognition method provided by the present disclosure;

[0024] Figure 7 is a schematic structural diagram of a multi-intent recognition device provided by the present disclosure;

[0025] Figure 8 It is a structural diagram of the electronic device provided by the present disclosure. DETAILED DESCRIPTION

[0026] To make the objectives, technical solutions, and advantages of this disclosure more clear, the technical solutions of this disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this disclosure, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of this disclosure without creative effort shall fall within the scope of protection of this disclosure.

[0027] The present disclosure provides a multi-intent recognition method. By adding an average expected loss function to the loss function, the expected value of the predicted intent output by the multi-intent label classification model can be encouraged to approach the expected value of the number of intents in the project (also known as the number of true intents). Based on the constructed multi-label classification basic data (corresponding to the unit batch of corpus to be recognized), the iterative training process and prediction process of the multi-intent label classification model can be used to continuously approach the expected value of the number of intents in the input unit batch of corpus to be recognized, thereby automatically and accurately obtaining multi-intent corpus with multi-intent labels.

[0028] Figure 1 This is one of the flow charts of the multi-intent recognition method provided by the present disclosure.

[0029] In order to further introduce the multi-intention recognition method provided by the present disclosure, the following Figure 1 Provide explanation.

[0030] In an exemplary embodiment of the present disclosure, Figure 1 It can be seen that the multi-intent recognition method may include step 110 and step 120, and each step will be introduced below.

[0031] In step 110 , a unit batch of corpora to be recognized is obtained, wherein the unit batch of corpora to be recognized includes a first preset number of multi-intent corpora to be recognized, and the multi-intent corpora to be recognized include a single intent label.

[0032] In one embodiment, a unit batch of corpora to be identified can be obtained. It is understandable that the unit batch of corpora to be identified can be a batch of corpora to be identified. In one example, the unit batch of corpora to be identified can include a first preset number of multi-intent corpora to be identified. Among them, the multi-intent corpora to be identified can be corpora to be identified that lack intent labels, that is, the multi-intent corpora to be identified can include a single intent label. In the application process, in order to obtain a complete multi-intent corpus, it is necessary to complete the missing intent labels in the multi-intent corpus to be identified.

[0033] In one embodiment, the first preset number may be one multi-intent to-be-recognized corpus. It is understandable that the unit batch of corpus to-be-recognized corpus in this scenario is one multi-intent to-be-recognized corpus.

[0034] It should be noted that a single multi-intent corpus to be identified is often independent. If a single multi-intent corpus to be identified is used as the processing object, it cannot be guaranteed that each multi-intent corpus to be identified can accurately supplement the missing intent labels. In the application process, if a unit batch of corpora to be identified (including the first preset number of multi-intent corpora to be identified) is used as the processing object, it can be ensured that the missing intent labels of the unit batch of corpora to be identified are supplemented.

[0035] In another example of the present disclosure, the first preset number can be multiple. In this scenario, the unit batch of corpus to be identified will be used as the processing object. By inputting the unit batch of corpus to be identified into the multi-intent label classification model, the unit batch multi-intent corpus output by the multi-intent label classification model is obtained, so that the number of intent labels of the unit batch multi-intent corpus corresponds to the expected value of the intent labels.

[0036] The first preset number can be adjusted according to actual conditions, and is not specifically limited in this embodiment.

[0037] In another exemplary embodiment of the present disclosure, multi-intent corpus to be recognized including a single intent label is obtained in the following manner: initial multi-intent corpus to be recognized that is not labeled with a single intent label is input into a single intent classification model, and the single intent classification model outputs multi-intent corpus to be recognized labeled with a single intent label, wherein the single intent classification model is pre-trained based on a seed corpus, and the dialogue application scenario of the seed corpus is the same as the dialogue application scenario of the multi-intent corpus to be recognized. In this embodiment, obtaining multi-intent corpus to be recognized including a single intent label based on a single intent classification model can realize the full automation of multi-intent recognition, thereby effectively reducing labor costs and improving recognition efficiency.

[0038] It should be noted that the initial multi-intent corpus to be identified can be understood as multi-intent corpus to be identified that is not labeled with a single intent label.

[0039] In another embodiment, the single intent tag of the multi-intent to-be-recognized corpus may be the main intent tag among the intent tags of the multi-intent to-be-recognized corpus.

[0040] It should be noted that when obtaining the probability values ​​of the various intent labels of the multi-intent corpus to be identified by the classification method, the intent label corresponding to the maximum probability value can be considered as the main intent label.

[0041] In another embodiment, the multi-intent to-be-identified corpus including a single intent label can also be directly obtained through manual annotation.

[0042] In step 120, the unit batch of corpus to be identified is input into the multi-intent label classification model to obtain the unit batch multi-intent corpus output by the multi-intent label classification model, so that the number of intent labels of the unit batch multi-intent corpus corresponds to the expected value of the intent label, wherein the unit batch multi-intent corpus includes a first preset number of multi-intent corpora, and the multi-intent corpus is the multi-intent corpus to be identified after multi-intent recognition.

[0043] In one embodiment, a multi-intent label classification model is obtained through pre-training based on a loss function, wherein the loss function may at least include an average expectation loss function (Average Expectation Loss, also known as AEL), and the average expectation loss function may be determined according to the expected value of the intent label.

[0044] In another embodiment, in order to ensure that the unit batch of corpora to be identified are input into the multi-intent label classification model, the unit batch of multi-intent corpora output by the multi-intent label classification model can be obtained, so that the number of intent labels of the unit batch of multi-intent corpora corresponds to the expected value of the intent labels, and the multi-intent label classification model needs to be iteratively trained based on the average expected loss function. Among them, the number of intent labels of the unit batch of multi-intent corpora corresponds to the expected value of the intent labels, which can be understood as the number of intent labels of the unit batch of multi-intent corpora is the same as the product of the expected value of the intent labels and the first preset number.

[0045] During the application process, the expected value of the intent label is determined based on the seed corpus with the same dialogue application scenario as the unit batch of corpus to be recognized. Therefore, the expected value of the intent label obtained based on the seed corpus can be considered as the expected value that the unit batch of corpus to be recognized needs to achieve.

[0046] Through the above embodiments, it is possible to ensure that the number of intent labels in a unit batch of multi-intent corpus meets the expected number of real intent labels. This allows for automatic and accurate comprehensive labeling of multi-intent labels, thereby reducing labor costs and improving labeling accuracy.

[0047] The multi-intent recognition method provided by the present disclosure pre-trains a multi-intent label classification model based on a loss function, wherein the loss function includes an average expected loss function, which is determined according to the expected value of the intent label. This ensures that the unit batch of corpus to be recognized is input into the multi-intent label classification model, and the unit batch of multi-intent corpus output by the multi-intent label classification model can be obtained, so that the number of intent labels of the unit batch of multi-intent corpus corresponds to the expected value of the intent label, ensuring that the number of intent labels of the unit batch of multi-intent corpus meets the expected number of real intent labels. This achieves automatic and accurate comprehensive labeling of multi-intent labels, thereby reducing labor costs and improving labeling accuracy.

[0048] In order to further introduce the multi-intention recognition method provided by the present disclosure, the following Figure 2 Provide explanation.

[0049] In an exemplary embodiment of the present disclosure, Figure 2 It can be seen that obtaining a multi-intent label classification model through pre-training based on a loss function may include steps 210 and 220, and each step will be introduced below.

[0050] In step 210, a second preset amount of seed corpora is obtained, wherein the seed corpora include target intent labels, and the dialogue application scenario of the seed corpora is the same as the dialogue application scenario of the unit batch of corpora to be identified.

[0051] In one embodiment, the seed corpus can be obtained from a corpus database and manually annotated. The seed corpus is also a corpus with multiple intent tags, wherein the seed corpus can include a target intent tag, which can be the main intent tag among the multiple intent tags of the seed corpus. The target intent tag can also be another intent tag other than the main intent tag (corresponding to the additional intent tag of the present disclosure).

[0052] In another embodiment, the seed corpus can also be obtained by processing the single-intent classification model. During the application process, the seed corpus marked with the target intent label is input into the single-intent classification model, and the seed corpus marked with the target intent label can be directly output.

[0053] It should be noted that the dialogue application scenario of the seed corpus is the same as that of the unit batch corpus to be recognized. Since the dialogue application scenario of the seed corpus is the same as that of the unit batch corpus to be recognized, the multi-intent label classification model obtained based on the seed corpus pre-training can ensure that the unit batch corpus to be recognized is input into the multi-intent label classification model, and the unit batch multi-intent corpus output by the multi-intent label classification model can be obtained, so that the number of intent labels of the unit batch multi-intent corpus corresponds to the expected value of the intent labels, thereby making the number of intent labels of the unit batch multi-intent corpus meet the expected number of real intent labels.

[0054] In another embodiment, a small amount of seed corpus can be constructed that matches the actual intent distribution in the project (corresponding to the unit batch of corpus to be identified). The seed corpus can be obtained by processing the labeled single-intent classification corpus in the single-intent dialogue system. During application, the multi-classification model can be used to predict the scores of each intent corresponding to each query. The training data with predicted scores below a certain threshold can be extracted and annotated again to complete the construction of the seed corpus.

[0055] Furthermore, the distribution of intents in a second preset number of seed corpora can be calculated to obtain an average expected value of intents for the second preset number of seed corpora. This expected value can represent the expected number of intents in this scenario (corresponding to the expected value of intent labels). The second preset number can be adjusted based on actual conditions and is not specifically limited in this embodiment.

[0056] In another embodiment, the target intent label can be the primary intent label among the intent labels of the seed corpus. The seed corpus can be generated by obtaining training corpus, where the training corpus includes multiple intent labels; inputting the training corpus into a single-intent classification model to obtain seed corpus output by the single-intent classification model, where the seed corpus includes the primary intent label, and the single-intent classification model is pre-trained. It is understood that the training corpus is the seed corpus without the primary intent label.

[0057] In step 220, the multi-intent label classification model is iteratively trained for multiple rounds based on the loss function until the average expected loss function in the loss function is less than or equal to the loss value threshold, wherein the output of the multi-intent label classification model in the current round of training is used as the input of the multi-intent label classification model in the next round of training, and the second preset number of seed corpora are the input of the multi-intent label classification model in the first round of training.

[0058] In one embodiment, the multi-intent label classification model can be iteratively trained for multiple rounds according to the loss function until the average expected loss function in the loss function is less than or equal to the loss value threshold. In one example, the loss function can be a binary cross entropy loss function. By adding the average expected loss function constructed based on the expected value of the intent label to the loss function, the multi-intent label classification model can be forced to continuously adjust the number of intent labels in a batch prediction result during the training process, repeatedly iterate the training and prediction, so that the number of predicted labels is close to the actual number of item intent distributions (corresponding to the expected value of the intent label), and obtain a trained multi-intent label classification model.

[0059] It should be noted that the average expected loss function is mainly used to penalize the unpredicted labels that should be hit in a batch of the multi-intent label classification model, forcing the multi-intent label classification model to predict the currently unknown labels that should be hit.

[0060] In another embodiment, the initial input of the multi-intent label classification model is a multi-intent corpus to be identified whose intent label information is a single intent label. In other words, the input of the multi-intent label classification model during the first round of training is a second preset number of seed corpora. During the application process, the number of intent labels of the predicted multi-intent corpus to be identified is continuously increased, and finally the expected value of all predicted multi-intent corpora to be identified is consistent with the expected value of the actual number of intents in the project. In this way, a trained multi-intent label classification model can be obtained, so that the trained multi-intent label classification model can obtain a unit batch of multi-intent corpora based on the unit batch of corpora to be identified input into the model, wherein the number of intent labels of the unit batch of multi-intent corpora corresponds to the expected value of the intent labels.

[0061] Figure 3 This is a schematic diagram of the application scenario of the multi-intent label classification model provided by the present invention.

[0062] Combine Figure 3 It can be seen that in the process of training the multi-intent label classification model, the input of the model is the individual characters W(1)…W(n) in the seed corpus and the intent label placeholders L(1)…L(n). That is, the input part of the multi-intent label classification model is mainly the text spliced ​​by the user query and the intent placeholder label. After the BERE model characterizes the sentence and label information, the hidden representation h(1)…h(n), l(1)…l(n) of the seed corpus is obtained. After the cross-attention network is used to fuse the aggregated text features and label feature information, the probability value P(1)…P(n) of each intent label is obtained to predict multiple intents. In the application process, when the probability value of the intent label exceeds the probability threshold, it means that the intent label is established. At this point, determine whether the number of obtained intent labels meets the expected value of intent labels (this can be determined by whether the average expected loss function is less than or equal to the loss value threshold). If not, iterate the training and prediction process repeatedly to continuously increase the number of intent labels for the predicted query. That is, use the output of the multi-intent label classification model in the current round of training as the input of the multi-intent label classification model in the next round of training until the average expected loss function is less than or equal to the loss value threshold.

[0063] Through the above-mentioned embodiment, the training of the multi-intent label classification model can be completed, and then it can be ensured that the unit batch of corpus to be identified is input into the multi-intent label classification model, and the unit batch of multi-intent corpus output by the multi-intent label classification model can be obtained, so that the number of intent labels of the unit batch multi-intent corpus corresponds to the expected value of the intent label. In other words, the number of intent labels of the unit batch multi-intent corpus is made to meet the expectation of the number of real intent labels. It is achieved that the multi-intent labels can be fully labeled automatically and accurately, thereby reducing labor costs and improving labeling accuracy.

[0064] Figure 4 It is a flowchart of determining the average expected loss function provided by the present disclosure.

[0065] The following will be combined Figure 4 The process of determining the average expected loss function is explained.

[0066] In an exemplary embodiment of the present disclosure, Figure 4 It can be seen that determining the average expected loss function may include steps 410 to 430, and each step will be introduced below.

[0067] In step 410 , the number of intent tags of each sub-corpus is determined based on the number of target intent tags and the number of additional intent tags.

[0068] In one embodiment, the seed corpus may further include additional intent tags, where the additional intent tags may be other intent tags in addition to the target intent tag. It is understood that the sum of the number of target intent tags and the number of additional intent tags may be defined as the number of intent tags in each seed corpus.

[0069] In step 420 , the expected value of the intent tags is determined based on the average number of intent tags of the various sub-corpora.

[0070] Because the dialogue application scenario of the seed corpus is the same as that of the unit batch of corpus to be recognized, the multi-intent label classification model pre-trained based on the seed corpus can ensure that when the unit batch of corpus to be recognized is input into the multi-intent label classification model, the unit batch of multi-intent corpus output by the multi-intent label classification model can be obtained, so that the number of intent labels in the unit batch of multi-intent corpus corresponds to the expected value of intent labels. This ensures that the number of intent labels in the unit batch of multi-intent corpus meets the expected number of true intent labels.

[0071] In one example, the expected value of the intent tag may be determined based on an average value of the number of intent tags of various sub-corpora.

[0072] In step 430 , an average expected loss function is determined based on the expected value of the intent label and the number of predicted intent labels, where the number of predicted intent labels is the number of intent labels included in the output of the multi-intent label classification model during each round of training.

[0073] In an exemplary embodiment of the present disclosure, based on the expected value of the intent label and the number of predicted intent labels, determining the average expected loss function can be implemented in the following manner:

[0074] Obtaining an expected intention parameter based on the product of the second preset number and the expected value of the intention label;

[0075] Based on the difference between the expected intent parameters and the number of predicted intent labels, the average expected loss function is determined.

[0076] In one example, the average expected loss function may be determined by taking the square of the difference between the expected intent parameter and the number of predicted intent labels.

[0077] In one example, based on the expected value of the intent label and the number of predicted intent labels, the average expected loss function is determined, which can also be implemented using the following formula (1):

[0078]

[0079] Among them, AEL represents the average expected loss function; F represents the number of predicted intent labels; k represents the product of the second preset number and the expected value of the intent label, also known as the intent expectation parameter; L represents the total number of categories of the intent label; B represents the second preset number. It can be understood that It can correspond to the square of the difference between the expected intent parameter and the number of predicted intent labels.

[0080] According to formula (1), the smaller the AEL, the closer the number of predicted intent labels is to the product of the second preset number and the expected value of the intent labels, that is, the more the predicted intent labels are in line with the expected number of true intent labels. At this time, it means that the multi-intent label classification model is close to training completion.

[0081] Figure 6 This is the second flowchart of the multi-intent recognition method provided by the present disclosure.

[0082] In order to further introduce the multi-intention recognition method provided by the present disclosure, the following Figure 6 Provide explanation.

[0083] In an exemplary embodiment of the present disclosure, Figure 6 It can be seen that the multi-intent recognition method can include steps 610 to 690, and each step will be introduced below.

[0084] In step 610, a seed corpus is obtained.

[0085] In step 620 , the expected value of the intent is calculated based on the seed corpus.

[0086] In step 630 , training data for a single-intent classification model is obtained based on the seed corpus.

[0087] In step 640 , a single-intent classification model is trained based on the training data to obtain a trained single-intent classification model.

[0088] In one embodiment, the data required for model training (corresponding to seed corpus) can be prepared. In one example, the source of the seed corpus can mainly be the corpus of randomly sampled and annotated real conversation records in an actual project. During the application process, a preset number of conversation data in the project can be extracted, such as 10,000 random conversation data for annotation. The annotated data can sort the extracted logs from small to large according to the length of the text, slowly increase the difficulty of annotation, and ensure the accuracy of the data label. After the annotation is completed, the average number of intents of all queries (corresponding to the seed corpus) in the annotated data can be calculated. And the average number of intents of the seed corpus is used as the fixed expected value of the intent of the project (corresponding to the expected value of intent, also known as the expected value of intent label).

[0089] Furthermore, the multi-intent data in the annotated seed corpus can be split into single-intent samples to construct multi-classification training data (corresponding to the training data of the single-intent classification model). In one example, the Bert model can be used to train the single-intent multi-classification model to obtain the trained single-intent classification model. This process is mainly to ensure that the single-intent multi-classification model can accurately hit any single intent in the query.

[0090] In step 650 , the project log is input into the trained single-intent classification model.

[0091] In step 660 , based on the project log, the single-intent prediction corpus output by the trained single-intent classification model is obtained.

[0092] In step 670 , the single-intent prediction corpus is input into the multi-intent label classification model.

[0093] In one embodiment, a project log (also referred to as a query) can be extracted and input into a trained single-intent classification model to obtain the single intent of each query predicted by the trained single-intent classification model (corresponding to the single-intent prediction corpus), and the query containing a single-intent label is input into the multi-intent label classification model as the input corpus of the multi-intent label classification model.

[0094] In step 680 , it is determined whether the intention prediction value is close to the intention expectation value.

[0095] In step 690 , if the intent prediction value approaches the intent expected value, the multi-intent label classification model outputs the intent prediction value.

[0096] The multi-intent label classification model is trained based on the average expected loss function. The average expected loss function can be understood as penalizing the unpredicted labels that should be hit in a batch (corresponding to the project log) for the multi-intent label classification model, forcing the model to predict the currently unknown labels that should be hit.

[0097] For the multi-intent label classification model, the label information corresponding to the initial input query of the model is only a query with a single intent label. Through the repeated iterative training and prediction process of the multi-intent multi-label classification model, the number of intent labels of the predicted query is continuously increased, and finally the expected value of all predicted queries is consistent with the expected value of the actual number of intents in the project (corresponding to the expected value of intent), thereby enabling the multi-intent label classification model to output the intent prediction value to obtain more multi-intent corpus.

[0098] According to the above description, the multi-intent recognition method provided by the present disclosure pre-trains a multi-intent label classification model based on a loss function, wherein the loss function includes an average expected loss function, which is determined according to the expected value of the intent label. This ensures that the unit batch of corpus to be recognized is input into the multi-intent label classification model, and the unit batch of multi-intent corpus output by the multi-intent label classification model can be obtained, so that the number of intent labels of the unit batch multi-intent corpus corresponds to the expected value of the intent label, ensuring that the number of intent labels of the unit batch multi-intent corpus meets the expected number of real intent labels. This achieves automatic and accurate comprehensive labeling of multi-intent labels, thereby reducing labor costs and improving labeling accuracy.

[0099] Based on the same concept, the present disclosure also provides a multi-intention recognition device.

[0100] The multi-intent recognition device provided by the present disclosure is described below. The multi-intent recognition device described below and the multi-intent recognition method described above can be referenced to each other.

[0101] Figure 7 It is a structural diagram of the multi-intent recognition device provided by the present disclosure.

[0102] In an exemplary embodiment of the present disclosure, Figure 7 It can be seen that the multi-intent recognition device may include a first module 710 and a second module 720, and each module will be introduced below.

[0103] The first module 710 may be configured to obtain a unit batch of corpora to be recognized, wherein the unit batch of corpora to be recognized includes a first preset number of multi-intent corpora to be recognized, and the multi-intent corpora to be recognized include a single intent label;

[0104] The second module 720 can be configured to input the unit batch of corpora to be identified into the multi-intent label classification model to obtain the unit batch multi-intent corpora output by the multi-intent label classification model, so that the number of intent labels of the unit batch multi-intent corpora corresponds to the expected value of the intent labels, wherein the unit batch multi-intent corpora include a first preset number of multi-intent corpora, and the multi-intent corpora are the multi-intent corpora to be identified after multi-intent recognition, wherein the multi-intent label classification model is obtained through pre-training based on the loss function, wherein the loss function at least includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label.

[0105] In an exemplary embodiment of the present disclosure, the second module 720 may obtain a multi-intent label classification model through pre-training based on a loss function in the following manner:

[0106] Obtaining a second preset amount of seed corpora, wherein the seed corpora include target intent labels, and the dialogue application scenario of the seed corpora is the same as the dialogue application scenario of the unit batch of corpora to be recognized;

[0107] The multi-intent label classification model is trained for multiple rounds of iterative training based on the loss function until the average expected loss function in the loss function is less than or equal to the loss value threshold, wherein the output of the multi-intent label classification model in the current round of training is used as the input of the multi-intent label classification model in the next round of training, and the second preset number of seed corpora is used as the input of the multi-intent label classification model in the first round of training.

[0108] In an exemplary embodiment of the present disclosure, the seed corpus may further include additional intent tags, wherein the additional intent tags are other intent tags in addition to the target intent tag;

[0109] The second module 720 can determine the average expected loss function in the following manner:

[0110] Determine the number of intent tags for each sub-corpus based on the number of target intent tags and the number of additional intent tags.

[0111] Determine the expected value of intent labels based on the average number of intent labels in various sub-corpora;

[0112] Determine the average expected loss function based on the expected value of the intent label and the number of predicted intent labels, where the number of predicted intent labels is the number of intent labels included in the output of the multi-intent label classification model during each round of training.

[0113] In an exemplary embodiment of the present disclosure, the second module 720 may determine the average expected loss function based on the expected value of the intent label and the number of predicted intent labels in the following manner:

[0114] Obtaining an expected intention parameter based on the product of the second preset number and the expected value of the intention label;

[0115] Based on the difference between the expected intent parameters and the number of predicted intent labels, the average expected loss function is determined.

[0116] In an exemplary embodiment of the present disclosure, the first module 710 may obtain a multi-intent to-be-recognized corpus including a single intent tag in the following manner:

[0117] The initial multi-intent corpus to be identified without a single intent label is input into the single intent classification model, and the single intent classification model outputs the multi-intent corpus to be identified with a single intent label. The single intent classification model is pre-trained based on the seed corpus, and the dialogue application scenario of the seed corpus is the same as that of the multi-intent corpus to be identified.

[0118] Figure 8 An example of a physical structure diagram of an electronic device is shown below. Figure 8 As shown, the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute the multi-intent recognition method, which includes: obtaining a unit batch of corpus to be recognized, wherein the unit batch of corpus to be recognized includes a first preset number of multi-intent corpus to be recognized, and the multi-intent corpus to be recognized includes a single intent label; inputting the unit batch of corpus to be recognized into the multi-intent label classification model to obtain a unit batch of multi-intent corpus output by the multi-intent label classification model, so that the number of intent labels of the unit batch of multi-intent corpus corresponds to the expected value of the intent label, wherein the unit batch of multi-intent corpus includes a first preset number of multi-intent corpus, and the multi-intent corpus is the multi-intent corpus to be recognized after multi-intent recognition, wherein the multi-intent label classification model is obtained through pre-training based on the loss function, wherein the loss function at least includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label.

[0119] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0120] On the other hand, the present disclosure also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the multi-intent recognition method provided by the above methods, and the multi-intent recognition method includes: obtaining a unit batch of corpus to be recognized, wherein the unit batch of corpus to be recognized includes a first preset number of multi-intent corpus to be recognized, and the multi-intent corpus to be recognized includes a single intent label; inputting the unit batch of corpus to be recognized into a multi-intent label classification model to obtain a unit batch of multi-intent corpus output by the multi-intent label classification model, so that the number of intent labels of the unit batch of multi-intent corpus corresponds to the expected value of the intent label, wherein the unit batch of multi-intent corpus includes a first preset number of multi-intent corpus, and the multi-intent corpus is the multi-intent corpus to be recognized after multi-intent recognition, wherein the multi-intent label classification model is obtained through pre-training based on the loss function, wherein the loss function at least includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label.

[0121] On the other hand, the present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the multi-intent recognition method provided by the above-mentioned methods, wherein the multi-intent recognition method includes: obtaining a unit batch of corpora to be recognized, wherein the unit batch of corpora to be recognized includes a first preset number of multi-intent corpora to be recognized, and the multi-intent corpora to be recognized include a single intent label; inputting the unit batch of corpora to be recognized into a multi-intent label classification model to obtain a unit batch of multi-intent corpora output by the multi-intent label classification model, so that the number of intent labels of the unit batch of multi-intent corpora corresponds to the expected value of the intent label, wherein the unit batch of multi-intent corpora includes a first preset number of multi-intent corpora, and the multi-intent corpora are multi-intent corpora to be recognized after multi-intent recognition, wherein the multi-intent label classification model is obtained through pre-training based on the loss function, wherein the loss function at least includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label.

[0122] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0123] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0124] It is further understood that although operations are described in a particular order in the drawings in the embodiments of the present disclosure, this should not be construed as requiring that the operations be performed in the particular order shown or in a serial order, or that all of the operations shown be performed to obtain the desired results. In certain circumstances, multitasking and parallel processing may be advantageous.

[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present disclosure.

Claims

1. A multi-intent recognition method, characterized in that: The multi-intent recognition method includes: Acquire a unit batch of corpora to be recognized, wherein the unit batch of corpora to be recognized includes a first preset number of multi-intent corpora to be recognized, and the multi-intent corpora to be recognized include a single intent label; Inputting the unit batch of corpora to be identified into a multi-intent label classification model to obtain a unit batch of multi-intent corpora output by the multi-intent label classification model, so that the number of intent labels of the unit batch of multi-intent corpora corresponds to the expected value of intent labels, wherein the unit batch of multi-intent corpora includes a first preset number of multi-intent corpora, and the multi-intent corpora are multi-intent corpora to be identified after multi-intent recognition, wherein the expected value of intent labels is determined according to the number of intent labels of a seed corpus, wherein the seed corpus includes a target intent label, and the dialogue application scenario of the seed corpus is the same as the dialogue application scenario of the unit batch of corpora to be identified; The multi-intent label classification model is obtained through pre-training based on a loss function, wherein the loss function at least includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label.

2. The multi-intention recognition method according to claim 1, characterized in that: The multi-intent label classification model is obtained through pre-training based on the loss function, specifically including: Obtaining a second preset amount of seed corpus; The multi-intent label classification model is iteratively trained for multiple rounds based on the loss function until the average expected loss function in the loss function is less than or equal to the loss value threshold, wherein the output of the multi-intent label classification model in the current round of training is used as the input of the multi-intent label classification model in the next round of training, and the second preset number of seed corpora is used as the input of the multi-intent label classification model in the first round of training.

3. The multi-intention recognition method according to claim 2, characterized in that: The seed corpus further includes additional intent tags, wherein the additional intent tags are other intent tags except the target intent tag; The average expected loss function is determined in the following way: Determining the number of intent tags for each of the seed corpora based on the number of the target intent tags and the number of the additional intent tags; Determining the expected value of the intent label based on an average value of the number of intent labels of each of the seed corpora; The average expected loss function is determined based on the expected value of the intent label and the number of predicted intent labels, wherein the number of predicted intent labels is the number of intent labels included in the output of the multi-intent label classification model during each round of training.

4. The multi-intention recognition method according to claim 3, characterized in that: Determining the average expected loss function based on the expected value of the intent label and the number of predicted intent labels specifically includes: Obtaining an expected intention parameter based on the product of the second preset number and the expected value of the intention label; The average expected loss function is determined based on the difference between the intention expectation parameter and the number of predicted intention labels.

5. The multi-intention recognition method according to claim 1, characterized in that: The multi-intent corpus to be identified, including a single intent label, is obtained in the following way: The initial multi-intent corpus to be identified that is not labeled with a single intent label is input into the single intent classification model to obtain the multi-intent corpus to be identified that is labeled with a single intent label and output by the single intent classification model, wherein the single intent classification model is pre-trained based on the seed corpus, and the dialogue application scenario of the seed corpus is the same as the dialogue application scenario of the multi-intent corpus to be identified.

6. A multi-intention recognition device, characterized in that: The multi-intention recognition device includes: The first module is configured to obtain a unit batch of corpora to be recognized, wherein the unit batch of corpora to be recognized includes a first preset number of multi-intent corpora to be recognized, and the multi-intent corpora to be recognized include a single intent label; The second module is used to input the unit batch of corpora to be identified into the multi-intent label classification model to obtain the unit batch multi-intent corpora output by the multi-intent label classification model, so that the number of intent labels of the unit batch multi-intent corpora corresponds to the expected value of the intent labels, wherein the unit batch multi-intent corpora include a first preset number of multi-intent corpora, and the multi-intent corpora are multi-intent corpora to be identified after multi-intent recognition, wherein the expected value of the intent label is determined according to the number of intent labels of the seed corpus, wherein the seed corpus includes the target intent label, and the dialogue application scenario of the seed corpus is the same as the dialogue application scenario of the unit batch corpora to be identified; The multi-intent label classification model is obtained through pre-training based on a loss function, wherein the loss function at least includes an average expected loss function, and the average expected loss function is determined according to the expected value of the intent label.

7. The multi-intention recognition device according to claim 6, characterized in that: The second module obtains a multi-intent label classification model through pre-training based on the loss function in the following way: Obtaining a second preset amount of seed corpus; The multi-intent label classification model is iteratively trained for multiple rounds based on the loss function until the average expected loss function in the loss function is less than or equal to the loss value threshold, wherein the output of the multi-intent label classification model in the current round of training is used as the input of the multi-intent label classification model in the next round of training, and the second preset number of seed corpora is used as the input of the multi-intent label classification model in the first round of training.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the multi-intention recognition method as described in any one of claims 1 to 5 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the multi-intention recognition method according to any one of claims 1 to 5 is implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the multi-intention recognition method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Song tag arrangement and access method and device, equipment, medium and product

    CN114048347A

  • Vital text analytics system for the enhancement of requirements engineering documents and other documents

    US20140172417A1