Intention recognition sample generation method and apparatus, model training method and apparatus, and intention recognition method and apparatus
By screening and marking target keywords in intent recognition samples, high-quality sample data sets are generated, which solves the problem of misrecognition and missed recognition of existing intent recognition models in target user screening, and improves the accuracy and model of intent recognition. training effect.
Patent Information
- Application Number
- PCT/CN2023/141589
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2023-12-25
- Publication Date
- 2024-09-06
AI Technical Summary
Existing intent recognition models have problems with misrecognition and missed recognition when screening target users, and the quality of the sample data set directly affects the model training effect, resulting in low accuracy of intent recognition.
By using keyword-level information based on the preset keyword lexicon, candidate recognition samples containing target keywords are screened out from the original intent recognition samples, the prompt information is marked, and a target sample data set is generated, which is used to train the intent recognition model and make the model Pay more attention to target keywords, thereby improving the training accuracy of model parameters.
Effectively reduce the sample space, improve the model's recognition accuracy of target keywords, enhance the training effect of the intent recognition model, and reduce misrecognition and missed recognition.
Smart Images

Figure CN2023141589_06092024_PF_FP
Abstract
Description
Generation of intent recognition samples, model training, intent recognition method and device
[0001] Cross-references
[0002] The present invention claims priority to Chinese patent application No. 202310179331.5 filed with the Patent Office of China on February 27, 2023, entitled “Generation of Intent Recognition Samples, Model Training, Intent Recognition Method and Device”. The entire contents of the application are incorporated herein by reference. Technical Field
[0003] The present application relates to the field of artificial intelligence technology, and in particular to a method and device for generating intent recognition samples, training a model, and identifying intent. Background Art
[0004] With the continuous development of artificial intelligence technology, user intent recognition based on trained intent recognition models, thereby screening target users with specific intent, has been widely used in many scenarios. For example, in the application scenario of outbound marketing, in order to reduce the user complaint rate, the intent of outbound users can be recognized based on the content of the first conversation to screen out target users with complaint intentions. The target users can be added to a blacklist or graylist, thereby avoiding secondary marketing to users on the blacklist or graylist. Based on this, in order to improve the accuracy of intent recognition, it is necessary to provide a training method for intent recognition models with higher model parameter accuracy. However, the accuracy of the model parameters is usually directly related to the sample data set. Therefore, it is necessary to provide a technical solution that can obtain more valuable sample data sets.
[0005] Summary of the Invention
[0006] The purpose of this application is to provide a method and device for generating intent recognition samples, training models, and identifying intent, which can enable the model to quickly identify target keywords that require special attention, thereby improving the accuracy of model parameter training.
[0007] In order to implement the above technical solution, this application is implemented as follows:
[0008] On the one hand, the present application provides a method for generating intent recognition samples, the method comprising: determining a first candidate recognition sample from multiple original intent recognition samples based on keyword hierarchy information of a preset keyword vocabulary; the first candidate recognition sample includes at least one target keyword that satisfies the constraint conditions corresponding to the keyword hierarchy information; based on the target keyword, marking prompt information on the first candidate recognition sample to obtain a first target recognition sample; based on the first target recognition sample, generating a target sample data set; the target sample data set is used to train an intent recognition model, and the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0009] On the one hand, the present application provides a method for training an intent recognition model, which includes: obtaining a target sample data set; the target sample data set includes multiple target recognition samples, each of the target recognition samples includes a candidate recognition sample, and prompt information of the target keyword in the candidate recognition sample; the target sample data set is input into the intent recognition model to be trained to iteratively update the model parameters to obtain a trained intent recognition model; the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0010] On the one hand, the present application provides an intent recognition method, which includes: determining the target keyword in the original text sentence to be recognized based on the keyword hierarchy information of a preset keyword vocabulary; the target keyword is a keyword that satisfies the constraint conditions corresponding to the keyword hierarchy information; based on the target keyword, marking the original text sentence with prompt information to obtain a target text sentence; inputting the target text sentence into a trained intent recognition model for intent recognition to obtain an intent recognition result; the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0011] On the one hand, the present application provides a device for generating intent recognition samples, the device comprising: a candidate sample set acquisition module, for determining a first candidate recognition sample from multiple original intent recognition samples based on keyword hierarchy information of a preset keyword vocabulary; each of the first candidate recognition samples includes at least one target keyword that satisfies the constraint conditions corresponding to the keyword hierarchy information; a keyword prompt marking module, for marking prompt information on the first candidate recognition sample based on the target keyword to obtain a first target recognition sample; a target sample set generation module, for generating a target sample data set based on the first target recognition sample; the target sample data set is used to train an intent recognition model, and the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0012] On the one hand, the present application provides an intention recognition model training device, which includes: a target sample set acquisition module, used to obtain a target sample data set; the target sample data set includes multiple target recognition samples, each of the target recognition samples includes a candidate recognition sample, and prompt information of the target keyword in the candidate recognition sample; an intention recognition model training module, used to input the target sample data set into the intention recognition model to be trained to iteratively update the model parameters to obtain a trained intention recognition model; the intention recognition model increases the attention level of the target keyword based on the prompt information.
[0013] On the one hand, the present application provides an intention recognition device, which includes: a keyword determination module, which is used to determine the target keyword in the original text sentence to be recognized based on the keyword hierarchy information of a preset keyword vocabulary; the target keyword is a keyword that meets the corresponding constraint conditions of the keyword hierarchy information; a keyword prompt marking module, which is used to mark the original text sentence with prompt information based on the target keyword to obtain a target text sentence; an intention recognition module, which is used to input the target text sentence into a trained intention recognition model for intention recognition to obtain an intention recognition result; the intention recognition model increases the attention level of the target keyword based on the prompt information.
[0014] In one aspect, the present application provides a computer device, comprising: a processor; and a memory arranged to store computer-executable instructions, wherein the executable instructions are configured to be executed by the processor, and the executable instructions include instructions for executing the steps in the above method.
[0015] On the one hand, the present application provides a storage medium, wherein the storage medium is used to store computer-executable instructions, and the executable instructions enable a computer to execute the steps in the above method.
[0016] On the one hand, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above-mentioned computer program is operable to enable a computer to execute the above-mentioned method. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in one or more of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] FIG1 is a schematic diagram of a first flow chart of a method for generating an intent recognition sample provided in an embodiment of the present application;
[0019] FIG2a is a schematic diagram of a second flow chart of a method for generating an intent recognition sample provided in an embodiment of the present application;
[0020] FIG2 b is a schematic diagram of a first implementation principle of a method for generating an intent recognition sample provided in an embodiment of the present application;
[0021] FIG3 is a schematic diagram of a third flow chart of the method for generating intent recognition samples provided in an embodiment of the present application;
[0022] FIG4 is a schematic diagram of a second implementation principle of the method for generating intent recognition samples provided in an embodiment of the present application;
[0023] FIG5 is a fourth flow chart of a method for generating an intent recognition sample provided in an embodiment of the present application;
[0024] FIG6 is a schematic diagram of a third implementation principle of the method for generating intent recognition samples provided in an embodiment of the present application;
[0025] FIG7 is a flow chart of an intent recognition model training method provided in an embodiment of the present application;
[0026] FIG8 is a schematic diagram showing the implementation principle of the intent recognition model training method provided in an embodiment of the present application;
[0027] FIG9a is a schematic diagram of a first flow chart of an intention recognition method provided in an embodiment of the present application;
[0028] FIG9 b is a schematic diagram of a second flow chart of the intention recognition method provided in an embodiment of the present application;
[0029] FIG10 is a schematic diagram showing the implementation principle of the intention recognition method provided in an embodiment of the present application;
[0030] FIG11 is a schematic diagram of the module composition of a device for generating intent recognition samples provided in an embodiment of the present application;
[0031] FIG12 is a schematic diagram of the module composition of the intention recognition model training device provided in an embodiment of the present application;
[0032] FIG13 is a schematic diagram of the module composition of the intention recognition device provided in an embodiment of the present application;
[0033] FIG14 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the technical solutions in one or more of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of one or more embodiments of the present application, rather than all embodiments. Based on one or more embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0035] It should be noted that, in the absence of conflict, one or more embodiments and features in the embodiments of the present application may be combined with each other. The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0036] One or more embodiments of the present application provide a method and apparatus for generating an intent recognition sample, training a model, and identifying an intent. Taking into account the application scenario of user intent recognition, target users with specific intents are screened out from multiple users, that is, target users and non-target users are distinguished from multiple users. For target users, a specific business processing method is used for subsequent business processing. For example, if the specific intent is complaint intent, target users with complaint intent are screened out from a large number of first-time outbound call users to avoid secondary marketing for such users. For another example, if the specific intent is loan intent, target users with loan intent are screened out from a large number of candidate users to conduct precision marketing for such users. Commonly used user intent recognition methods mainly include: in some example implementations In the example, by presetting various matching rules, if the user's answer statement or question statement hits any matching rule, the user is determined to be the target user; however, the accuracy and comprehensiveness of the preset matching rules directly affect the screening accuracy of the target user, and there are bound to be problems of misidentification and missed identification; in other example embodiments, a pre-trained intent recognition model is used to identify the user's intent, and if the user's intent recognition result indicates that the user has a specific intention, the user is determined to be the target user; however, the parameter accuracy of the intent recognition model directly affects the screening accuracy of the target user, and the selection of the sample data set directly affects the training effect of the intent recognition model. Therefore, if the sample data set contains a large number of useless samples, the training effect of the intent recognition model will inevitably be reduced. Based on the above problems, the present technical solution provides a technical solution that can obtain a more valuable sample data set. For the generation process of intent recognition samples, first, based on the keyword hierarchy information of the preset keyword vocabulary, M first candidate recognition samples (i.e., original intent recognition samples containing at least one target keyword, that is, samples that will be identified as suspicious samples with specific intent) are screened out from N original intent recognition samples; then, based on the target keywords in the first candidate recognition samples, prompt information is marked (i.e., prompt information is marked on the first candidate recognition samples) to obtain corresponding first target recognition samples; that is, the target keywords in the first candidate recognition samples are marked so that the intent recognition model will focus more on the target keywords as effective guidance information in the model training stage; then, a target sample data set is generated based on the M first target recognition samples; wherein, the original samples that do not contain the preset keywords are first filtered out based on the keyword hierarchy information, thereby reducing the sample space by screening out useless samples; then, the target keywords in the candidate recognition samples identified when screening out useless samples and retaining suspicious samples are marked with prompt information to obtain the target recognition samples finally used for model training. This can prompt the model to quickly identify the target keywords that require special attention, thereby improving the training accuracy of the model parameters.
[0037] FIG1 is a flow chart of a method for generating an intent recognition sample provided by one or more embodiments of the present application. The method in FIG1 can be executed by an electronic device provided with a device for generating an intent recognition sample, which can be a terminal device or a designated server. It should be noted that based on the method for generating an intent recognition sample provided by an embodiment of the present application, the intent recognition obtained through training can be applied to any specific application scenario that requires identifying target users with specific intentions. For example, target users with complaint intentions can be screened out from a large number of first-time outbound call users to avoid secondary marketing for such users; or target users with loan intentions can be screened out from a large number of candidate users to conduct precision marketing for such users. As shown in FIG1 , the method includes at least the following steps:
[0038] S100, determining a first candidate recognition sample from a plurality of original intent recognition samples based on keyword hierarchy information of a preset keyword vocabulary; the first candidate recognition sample includes at least one target keyword that satisfies a constraint condition corresponding to the keyword hierarchy information;
[0039] The above-mentioned keyword level information corresponding constraint conditions are used to constrain the conditions for determining the target keywords based on the keyword level information. For example, if the above-mentioned keyword level information includes the level information of each preset keyword, then the above-mentioned keyword level information corresponding constraint conditions may include a constraint condition that the keyword level is ranked high, and the above-mentioned at least one target keyword that meets the keyword level information corresponding constraint conditions is a keyword with a high keyword level ranking in the original intention recognition sample corresponding to the first candidate recognition sample; for example, if the above-mentioned keyword level information includes the level information of each preset keyword and the intention strength information under the same keyword level, then the above-mentioned keyword level information corresponding constraint conditions may include a constraint condition that the keyword level is ranked high and the intention strength is ranked high, and the above-mentioned at least one target keyword that meets the keyword level information corresponding constraint conditions is a keyword with a high keyword level ranking and a high intention strength ranking in the original intention recognition sample corresponding to the first candidate recognition sample.
[0040] S200, based on the target keyword, marking prompt information on the first candidate recognition sample to obtain a first target recognition sample;
[0041] S300, generating a target sample data set based on the first target recognition sample; the target sample data set is used to train an intent recognition model, and the intent recognition model increases the attention level of the target keyword in the first target recognition sample based on the above prompt information.
[0042] In some example embodiments, taking the number of the original intent recognition samples as N as an example, as shown in FIG2a , the method for generating the intent recognition samples includes at least the following steps:
[0043] S102, obtaining an original sample data set; wherein the original sample data set includes N original intent recognition samples.
[0044] The above N is an integer greater than 1; each original intent recognition sample can be a text sentence sample, which can be a customer text sentence in the conversation between the agent and the customer; the customer text sentence can be the customer's consultation question or the customer's answer sentence; for example, for a loan business, the agent pushes a certain credit product to a certain customer, and it is necessary to identify whether the customer has a complaint intention based on the customer's answer sentence. For example, the customer's answer sentence can be: "You yyyyy I am not interested in your loan"; yyyyy represents an uncivilized word.
[0045] Considering that customer text sentences contain relatively few words, such customer text sentences can be directly filtered out, or the user intent can be determined directly based on keyword matching. That is, customer text sentences with a word count less than the preset word count threshold will not be input into the model as samples. Therefore, each original intent recognition sample in the original sample data set is a customer text sentence that meets the sentence word count constraint.
[0046] S104, based on the keyword hierarchy information of the preset keyword vocabulary, determine M first candidate recognition samples from the above-mentioned N original intent recognition samples; wherein each first candidate recognition sample includes at least one target keyword that meets the preset keyword hierarchy constraint condition.
[0047] The above-mentioned M and N are both integers greater than 1 and M is less than N. The above-mentioned preset keyword vocabulary may include multiple preset keywords related to specific intentions. For example, if the specific intention is complaint intention, the preset keyword vocabulary may include multiple preset keywords that represent complaint intentions, such as "regulatory agency", "not interested", etc.
[0048] The preset keyword level constraint condition is the constraint condition corresponding to the above-mentioned keyword level information. The above-mentioned keyword level information may include the level information of each preset keyword. For example, it is divided into three keyword levels. The keyword levels are ranked from high to low as follows: level 3, level 2 and level 1. The preset keywords belonging to level 3 may be obvious complaint words, for example, "regulatory agency", the preset keywords belonging to level 2 may be uncivilized words, and the preset keywords belonging to level 1 may be offensive words, for example, "not interested"; correspondingly, the above-mentioned preset keyword level constraint condition includes a constraint condition for the keyword level to be ranked high. At least one target keyword that meets the preset keyword level constraint condition is ranked high in the original intent recognition sample corresponding to the first candidate recognition sample. n keywords, n is an integer greater than or equal to 1; in some example embodiments, the above-mentioned keyword hierarchical information may also include the level information of each preset keyword and the intention strength information at the same keyword level. For example, multiple preset keywords belonging to the same keyword level are divided into strong intention and weak intention, such as the preset keywords "not interested" and "not needed" both belong to level 1, and "not needed" has a strong intention, and "not interested" has a weak intention. Correspondingly, the above-mentioned preset keyword hierarchical constraints include constraints that the keyword level is ranked high and the intention strength is ranked high. At least one target keyword that meets the above-mentioned preset keyword hierarchical constraints is the n keywords that are ranked high in the keyword level and the intention strength in the original intention recognition sample corresponding to the first candidate recognition sample.
[0049] Each first candidate recognition sample corresponds to an original intent recognition sample, and at least one target keyword in the first candidate recognition sample includes the n keywords with the highest keyword hierarchy ranking in the corresponding original intent recognition sample, that is, the n keywords with the highest keyword level ranking, or the n keywords with the highest keyword level ranking and the highest intent strength ranking, that is, the keywords that are more helpful in identifying whether the user has a specific intent are prioritized.
[0050] Regarding the keyword matching process, in some example embodiments, each word segment in the original intent recognition sample may be matched with each preset keyword in the preset keyword library; however, considering that the original intent recognition sample needs to be segmented in advance, and the accuracy of the word segmentation processing will affect the matching results, in other example embodiments, the original intent recognition sample can be used as a whole matching object, and different preset keywords can be selected from the preset keyword library in turn, and the currently selected preset keyword can be matched with the original intent recognition sample to determine whether there is a continuous word (i.e., a word consisting of at least two adjacent words) in the original intent recognition sample that matches the preset keyword.
[0051] A preset keyword can be randomly selected from the preset keyword vocabulary each time to match the original intent recognition sample, and whether the original intent recognition sample contains the target keyword can be determined based on the matching results of each preset keyword, so as to determine the M first candidate recognition samples among the N original intent recognition samples, that is, the keyword level information is not considered in the keyword matching process; however, considering that in the process of keyword prompt information marking, the marking object is the n target keywords with the highest keyword level ranking in the first candidate recognition sample, and considering that in the process of keyword matching, if the keyword level information is considered, then the first n keywords that are successfully matched are the n target keywords with the highest keyword level ranking in the first candidate recognition sample; therefore, the original intent recognition sample can be keyword matched based on the keyword level information of the preset keyword vocabulary in the order of keyword level from high to low; if it is determined that the original intent recognition sample does not contain the preset keyword, that is, the original intent recognition sample and all the preset keywords in the preset keyword vocabulary are matched. If no words are matched, that is, all preset keywords in the preset keyword vocabulary are matched, and there are no matching words in the original intent recognition sample, then the original intent recognition sample is determined as a useless sample, that is, such original intent recognition samples are filtered out, thereby reducing the sample space; if the top n target keywords in the keyword hierarchy ranking that are successfully matched in the original intent recognition sample are determined, then the original intent recognition sample is determined as a first candidate recognition sample (that is, such original intent recognition sample is retained), and the top n target keywords are determined as at least one target keyword in the first candidate recognition sample that meets the preset keyword hierarchy constraint conditions; this not only improves the selection efficiency of the M first candidate recognition samples, but also can quickly lock the target keyword that needs to be marked with prompt information in the first candidate recognition sample, that is, only through the step of keyword matching, it is possible to select M first candidate recognition samples from N original intent recognition samples, and also determine the target keyword that needs to be marked with prompt information in the first candidate recognition sample.
[0052] Taking the target keyword with the highest keyword level in the first candidate recognition sample as an example, that is, in the process of marking the keyword prompt information, the marking object is the target keyword with the highest keyword level in the first candidate recognition sample (that is, the above n is equal to 1), then, it is only necessary to determine the first successfully matched target keyword in the original intention recognition sample based on the keyword level information, and it is not necessary to determine all the keywords in the original intention recognition sample that match any preset keyword in the preset keyword thesaurus; if the first successfully matched target keyword in the original intention recognition sample is determined, the original intention recognition sample is directly determined as the first candidate recognition sample, and the first successfully matched target keyword is determined as the target keyword that needs to be marked with prompt information.
[0053] In the process of keyword matching the original intent recognition sample, only the first target keyword in the original intent recognition sample can be determined (that is, the above n is equal to 1), or multiple target keywords with a higher keyword hierarchy ranking in the original intent recognition sample can be determined (that is, the above n is greater than 1), or all keywords in the original intent recognition sample that match any preset keyword in the preset keyword library can be determined; the number of the above at least one target keyword can be related to the number required by the prompt information mark, for example, if the number required by the prompt information mark is 1, then the number of the at least one target keyword is 1.
[0054] S106 , for each first candidate recognition sample, based on the corresponding target keyword, the first candidate recognition sample is marked with prompt information to obtain a first target recognition sample; wherein the first target recognition sample includes the corresponding first candidate recognition sample and the prompt information of the corresponding target keyword.
[0055] Each first target recognition sample corresponds to a first candidate recognition sample. The first target recognition sample is based on the corresponding first candidate recognition sample and adds prompt information about at least one target keyword in the first candidate recognition sample; the at least one target keyword that needs to be prompted in the first candidate recognition sample is determined in the above step S104, that is, for each original intention recognition sample, the n target keywords with the top keyword hierarchy ranking are determined based on the keyword hierarchy information of the preset keyword vocabulary.
[0056] Regarding the process of marking prompt information for target keywords, in some example embodiments, the target keywords in the first candidate recognition sample may be marked, that is, the keyword mark is used as prompt information, that is, the number of keywords in the first target recognition sample remains unchanged; in other example embodiments, the target keywords may also be added at a specified position in the first candidate recognition sample, that is, the target keywords at the specified position are used as prompt information, that is, the number of keywords in the first target recognition sample increases, and two identical target keywords are included.
[0057] S108, generating a target sample data set based on the first target recognition samples corresponding to each first candidate recognition sample; wherein the above-mentioned target sample data set is used to train the intent recognition model, and the above-mentioned intent recognition model increases the attention level of the corresponding target keyword based on the prompt information in each first target recognition sample.
[0058] The above-mentioned target sample data set includes the first target recognition samples corresponding to M first candidate recognition samples, and the true label of each first target recognition sample, which represents whether it has a specific intention; the true label of the first target recognition sample is based on the true label of the corresponding original intention recognition sample, and the true label of the original intention recognition sample can be manually labeled or automatically generated and manually proofread; since the first target recognition sample, the first candidate recognition sample, and the original intention recognition sample correspond to each other, the true label of the first target recognition sample can be determined based on the true label of the original intention recognition sample.
[0059] Although each first candidate recognition sample contains at least one target keyword, the first candidate recognition sample can be a candidate recognition sample with a specific intention (that is, the true label is a positive sample with a specific intention), for example, "yyyyy I am not interested in your loan"; it can also be a candidate recognition sample without a specific intention (that is, the true label is a negative sample without a specific intention), for example, I can't operate your APP; among them, for negative samples that do not contain target keywords, since such negative samples are easily misidentified by rules, such negative samples have stronger learning value for the model.
[0060] Since the first target recognition sample not only includes the corresponding first candidate recognition sample (i.e., a certain original intent recognition sample), but also includes prompt information about at least one target keyword in the first candidate recognition sample, the intent recognition model can combine the keyword prompt information in the first target recognition sample to determine which keywords in the first candidate recognition sample belong to the target keywords that need special attention, thereby focusing more attention on the target keyword, increasing the attention score of the target keyword, and increasing the weight of the word vector of the target keyword, so that the intent recognition model can increase the attention level of the corresponding target keyword based on the prompt information in the first target recognition sample, which can provide more effective guidance to the intent recognition model and thereby improve the training accuracy of the model parameters.
[0061] In an embodiment of the present application, in the process of generating intent recognition samples, M first candidate recognition samples are first screened out from N original intent recognition samples based on the keyword hierarchy information of the preset keyword vocabulary. The first candidate recognition sample can be an original intent recognition sample containing at least one target keyword, which can be understood as a suspicious sample that will be identified as having a specific intent; then, based on the target keyword marking prompt information in the first candidate recognition sample, the corresponding first target recognition sample is obtained, that is, the target keyword in the first candidate recognition sample is marked, so that the intent recognition model will focus more attention on the target keyword as effective guidance information in the model training stage; then, a target sample data set is generated based on the M first target recognition samples; first, the original samples that do not contain the preset keywords are filtered out in combination with the keyword hierarchy information, thereby reducing the sample space by screening out useless samples; then, the target keywords in the candidate recognition samples identified when the useless samples are screened out and the suspicious samples are retained are marked with prompt information to obtain the target recognition samples finally used for model training, which can prompt the model to quickly identify the target keywords that need special attention, thereby improving the training accuracy of the model parameters.
[0062] As shown in FIG2b , taking the application scenario of identifying a target user with complaint intention as an example, the original sample dataset may include N original user statement samples. This embodiment of the application provides a specific implementation process of a method for generating intent recognition samples, which mainly includes:
[0063] (1) Obtain N original user sentence samples; for example, original user sentence sample 1 to original user sentence sample N; wherein N is an integer greater than 1, and each original user sentence sample satisfies a sentence word count constraint condition, that is, the word count is greater than a preset threshold.
[0064] (2) Perform keyword matching based on keyword hierarchy information of a preset keyword vocabulary to determine M first candidate recognition samples in the above-mentioned N original user sentence samples, and the target keyword with the highest hierarchy in each first candidate recognition sample; wherein M is an integer greater than 1 and less than N; for example, from the first candidate recognition sample 1 to the first candidate recognition sample M, the target keyword with the highest hierarchy in the first candidate recognition sample 1 is the target keyword 1, and the target keyword with the highest hierarchy in the first candidate recognition sample M is the target keyword M.
[0065] Based on the keyword hierarchy information of the preset keyword vocabulary, one keyword to be matched is selected in sequence in descending order of keyword hierarchy; keyword matching is performed on the keyword to be matched with the original user sentence sample; the first keyword with successful matching (i.e., the word in the original user sentence sample that matches the currently selected keyword to be matched) is determined as the target keyword with the highest hierarchy in the original user sentence sample, and the original user sentence sample is determined as the first candidate recognition sample; wherein, since the first candidate recognition sample corresponds to the original user sentence sample, the target keyword with the highest hierarchy in the first candidate recognition sample is the target keyword with the highest hierarchy in the corresponding original user sentence sample; if all preset keywords in the preset keyword vocabulary are matched and there is no matching word in the original user sentence sample, the original user sentence sample is determined as a useless sample, that is, such original user sentence samples are filtered out, and the remaining original user sentence samples containing the target keyword (i.e., M first candidate recognition samples) are left.
[0066] (3) For each first candidate recognition sample, based on the target keyword in the first candidate recognition sample, the first candidate recognition sample is marked with keyword prompt information to obtain a first target recognition sample; wherein the first target recognition sample includes the corresponding first candidate recognition sample and the prompt information of the corresponding target keyword; for example, the first target recognition sample 1 to the first target recognition sample M, the first target recognition sample 1 includes prompt information about the target keyword 1, and the first target recognition sample M includes prompt information about the target keyword M. Taking the example of adding the target keyword and the preset separator at the prefix position of the candidate recognition sample as the prompt information of the target keyword, the target keyword 1 and the preset separator are added at the prefix position of the first target recognition sample 1, and the target keyword M and the preset separator are added at the prefix position of the first target recognition sample M.
[0067] After obtaining M first target recognition samples, a target sample data set is generated based on the M first target recognition samples; wherein the above target sample data set is used to train the intent recognition model, and the above intent recognition model increases the attention level of the corresponding target keyword based on the prompt information in each first target recognition sample.
[0068] Considering that the intent recognition model can usually use the BERT (Bidirectional Encoder Representation from Transformers) model, and the BERT model usually recognizes the sentence before and after the separator as two sentences, therefore, in order to adapt to the input data format of the BERT model, without changing the components of the original sample data, the prompt information of the target keyword can be added to the prefix or suffix position of the first candidate recognition sample, rather than adding a preset separator at the target keyword, to avoid being mistakenly recognized as two sentences by the model. Based on this, the above S106, for each first candidate recognition sample, based on the corresponding target keyword, the first candidate recognition sample is marked with prompt information to obtain the first target recognition sample, specifically including:
[0069] Step 1: for each first candidate recognition sample, the target keyword and the preset separator corresponding to the first candidate recognition sample are used as prompt information of the target keyword.
[0070] Step 2: Add the prompt information at a designated position of the first candidate recognition sample; wherein the designated position includes a prefix position or a suffix position.
[0071] Step three: determining the first candidate recognition sample after adding the prompt information as the first target recognition sample corresponding to the first candidate recognition sample.
[0072] Take the target keyword with the highest keyword level marked in the first candidate recognition sample, and the designated position as the prefix position as an example. For example, a first candidate recognition sample is "You yyyyy I am not interested in your loan", and the target keyword with the highest keyword level includes "yyyyy" (i.e., uncivilized language). Therefore, the corresponding first target recognition sample can be expressed as "yyyyy [SEP] You yyyyy I am not interested in your loan".
[0073] Taking the two target keywords with the highest keyword hierarchy ranking in the first candidate recognition sample as an example, and the designated position is the prefix position, for example, a first candidate recognition sample is "You yyyyy I am not interested in your loan", the two target keywords with the highest keyword hierarchy ranking in the first candidate recognition sample include "yyyyy" (i.e., uncivilized language) and "not interested" (i.e., offensive words), among which the keyword hierarchy of "yyyyy" is higher than "not interested", so the corresponding first target recognition sample can be expressed as "yyyyy [SEP] not interested [SEP] you yyyyy I am not interested in your loan"; wherein, based on the order of the target keywords, the hierarchical relationship between multiple target keywords can be indicated, so that the model can set the weight coefficient of the target keyword targeted by the keyword prompt information with the highest ranking to be higher.
[0074] Regarding the process of selecting M first candidate recognition samples from the original sample data set, that is, the process of narrowing down the original sample space in a targeted manner based on the preset keyword vocabulary and screening out the useful sample space (i.e., multiple suspicious samples), considering that in the process of marking the keyword prompt information, the marked objects are the n target keywords with the highest keyword hierarchy ranking in the first candidate recognition sample, and considering that in the process of keyword matching, if the keyword hierarchy information is considered, then the first n keywords that are successfully matched are the n target keywords with the highest keyword hierarchy ranking in the first candidate recognition sample; therefore, the original intent recognition sample can be keyword matched in descending order of keyword hierarchy based on the keyword hierarchy information of the preset keyword vocabulary; and whether the original intent recognition sample is the first candidate recognition sample is determined based on the keyword matching result; the above S104, based on the keyword hierarchy information of the preset keyword vocabulary, determines the M first candidate recognition samples in the above N original intent recognition samples, specifically including:
[0075] Step 1: Based on the keyword hierarchy information of the preset keyword thesaurus, a keyword to be matched is selected from the preset keyword thesaurus; wherein the keyword to be matched is the preset keyword that has not been selected and has the highest hierarchy in the preset keyword thesaurus, and the first selected keyword to be matched is the preset keyword with the highest hierarchy in the preset keyword thesaurus; the second selected keyword to be matched is the preset keyword ranked second in the preset keyword thesaurus (that is, the preset keyword that has not been selected and has the highest hierarchy); for example, taking the example of keyword hierarchy information including the level information of each preset keyword, the preset keyword with the highest hierarchy refers to the preset keyword with the highest keyword level; the preset keyword that has not been selected and has the highest hierarchy refers to the preset keyword with the highest keyword level among the preset keywords other than those selected as the keywords to be matched; for another example, taking the example of keyword hierarchy information including the level information of each preset keyword and the intention strength information at the same keyword level, the preset keyword with the highest hierarchy refers to the preset keyword with the highest keyword level and the strongest intention; the preset keyword that has not been selected and has the highest hierarchy refers to the preset keyword with the highest keyword level and the strongest intention among the preset keywords other than those selected as the keywords to be matched.
[0076] Step 2: for each original intent recognition sample, determine whether the original intent recognition sample contains the above-mentioned keywords to be matched.
[0077] The above-mentioned keywords to be matched are matched with the original intent recognition sample. If the keywords to be matched are successfully matched with a continuous word (i.e., a word composed of multiple adjacent words) in the original intent recognition sample, it is determined that the above-mentioned keywords to be matched exist in the original intent recognition sample, and the continuous word is determined as the target keyword; then, if the number of determined target keywords is less than the preset threshold n, the next keyword to be matched is selected; if the keywords to be matched are unsuccessful in matching with any continuous word in the original intent recognition sample, it is determined that the above-mentioned keywords to be matched do not exist in the original intent recognition sample; then, if the currently selected keyword to be matched is not the keyword with the lowest level, the next keyword to be matched is selected.
[0078] Step three: if it exists, then determine the original intent recognition sample as a first candidate recognition sample; wherein, at least one target keyword in the first candidate recognition sample includes a keyword that matches the keyword to be matched.
[0079] If the target keyword with the highest level in the original intent recognition sample is determined, the original intent recognition sample can be directly determined as a first candidate recognition sample; then, if the number of determined target keywords is less than the preset threshold n, continue to select the next keyword to be matched to determine the target keyword with the second highest level in the original intent recognition sample, and so on.
[0080] Step 4: If the preset keyword matching stop condition does not exist or is not met, continue to select the next keyword to be matched from the preset keyword vocabulary based on the keyword hierarchy information; wherein, the preset keyword matching stop condition includes at least one of the following: the number of target keywords in the determined first candidate recognition sample is equal to the preset threshold, and the currently selected keyword to be matched is the keyword with the lowest hierarchy.
[0081] If the number of determined target keywords is equal to the preset threshold n, it is determined that the keyword matching of the original intent recognition sample is completed; or, if the currently selected keyword to be matched is the keyword with the lowest level, it is determined that the keyword matching of the original intent recognition sample is completed, that is, if all the preset keywords in the preset keyword vocabulary have been traversed and still not matched successfully, it means that the original intent recognition sample does not contain keywords, and it is filtered out; then, continue to use the same processing method to determine whether the next original intent recognition sample is the first candidate recognition sample, which will not be repeated here.
[0082] Taking into account that multiple preset keywords under the same keyword level may also have different intention strengths, for example, for application scenarios where the specific intention is complaint intention, the above-mentioned preset keyword vocabulary includes multiple preset keywords related to complaint intention; the above-mentioned keyword level information includes the keyword level information to which the preset keyword belongs and the complaint intention strength information of the preset keyword at its level.
[0083] The above step 1, based on the keyword level information of the preset keyword vocabulary, selects a keyword to be matched from the preset keyword vocabulary, specifically including:
[0084] Based on the keyword hierarchy information of the preset keyword vocabulary, among multiple unselected preset keywords, the preset keyword with the highest keyword level and the strongest complaint intention is selected.
[0085] The selected preset keyword is determined as a keyword to be matched; specifically, for multiple preset keywords in the preset keyword vocabulary, they are traversed in order from high to low keyword level and from strong to weak complaint intention.
[0086] Considering that screening suspicious samples from the original sample dataset based on the keyword hierarchical information of the preset keyword vocabulary will inevitably lead to a significant reduction in the number of samples, thereby resulting in an insufficient number of samples, in order to add more suspicious samples to ensure the number of samples ultimately used for model training, as shown in FIG3 , in the above S108, before generating the target sample dataset based on the first target recognition samples corresponding to each first candidate recognition sample, the following is further included:
[0087] S110 , performing data enhancement processing based on the above-mentioned M first candidate recognition samples to generate a new sample data set; wherein the new sample data set includes Q new intent recognition samples.
[0088] The above Q is an integer greater than 1. Data enhancement refers to obtaining a new intent recognition sample by modifying the first candidate recognition sample; for example, adding a preset word to the first candidate recognition sample, or deleting a word; for example, masking at least one specific keyword in the first candidate recognition sample, and then completing the masked first candidate recognition sample to obtain a new intent recognition sample; specifically, one first candidate recognition sample corresponds to at least one new intent recognition sample, and therefore, the new sample data set includes new intent recognition samples corresponding to multiple first candidate recognition samples.
[0089] The embodiment provided in this application does not limit the order of step S110 and the above-mentioned step S106.
[0090] S112, based on the Q newly added intent recognition samples and the keyword level information, determine P second candidate recognition samples; wherein each second candidate recognition sample includes at least one target keyword that meets the preset keyword level constraint condition.
[0091] The above P is an integer greater than 1 and P is less than Q. Each new intent recognition sample corresponds to a first candidate recognition sample, and each second candidate recognition sample corresponds to a new intent recognition sample. At least one target keyword in the second candidate recognition sample includes the n keywords with the highest keyword hierarchy ranking in the corresponding new intent recognition sample, that is, the n keywords with the highest keyword level ranking, or the n keywords with the highest keyword level ranking and the highest intent strength ranking.
[0092] After obtaining Q new intent recognition samples, candidate recognition samples containing at least one target keyword can be selected from the Q new intent recognition samples based on the keyword hierarchy information of the preset keyword vocabulary. The specific implementation process can refer to the screening process of the first candidate recognition sample mentioned above; however, considering that the semantics of the new intent recognition sample may be the same as or different from the semantics of the corresponding first candidate recognition sample, a recognition process for whether the semantics of the new intent recognition sample has changed can be introduced, and then based on the semantic recognition result, it is determined whether the true label of the new intent recognition sample is the same as or opposite to the true label of the corresponding first candidate recognition sample; in some example embodiments, a preset semantic recognition model can be used to identify whether the new intent recognition sample and the corresponding first candidate recognition sample have the same semantics, and the corresponding semantics can be obtained. semantic recognition result; the semantic recognition result may include a first probability characterizing that the two have the same semantics and a second probability characterizing that the two have different semantics; however, considering that if the first probability and the second probability in the semantic recognition result are not much different, that is, the semantics of the newly added intent recognition sample are the same as or different from the semantics of the corresponding first candidate recognition sample, the degree of distinction is not high, that is, the newly added intent recognition sample belongs to a sample with low target confidence, resulting in a low accuracy of determining the true label of the newly added intent recognition sample based on the semantic recognition result. Therefore, such newly added intent recognition samples with low target confidence can be screened out to avoid affecting the training accuracy of the model parameters due to the low accuracy of their true labels; and it is also possible to determine whether the semantics of the newly added intent recognition sample has changed based on the semantic recognition result, and then determine the true label of the second candidate recognition sample.
[0093] The process of determining P second candidate recognition samples can be based on the above-mentioned keyword hierarchy information and the preset semantic recognition model to determine P second candidate recognition samples from the Q new intent recognition samples; the target confidence of each second candidate recognition sample is greater than a preset threshold and includes at least one target keyword that satisfies the preset keyword hierarchy constraint condition; regarding the execution order of the two steps of keyword matching and semantic change identification, in some example embodiments, keyword matching can be performed on the new intent recognition samples first, and then semantic change identification is performed; specifically, based on the above-mentioned keyword hierarchy information, X initial candidate recognition samples are determined from the Q new intent recognition samples (that is, each initial candidate recognition sample contains at least one target keyword); then, the preset semantic recognition model is used to perform semantic change identification on the initial candidate recognition samples to determine P second candidate recognition samples with high target confidence from the X initial candidate recognition samples; X is an integer greater than 1.
[0094] In other example embodiments, semantic change recognition may be performed on the newly added intent recognition samples first, and then keyword matching may be performed; specifically, a preset semantic recognition model is used to perform semantic change recognition on Q newly added intent recognition samples, and Y initial newly added recognition samples with high target confidence are determined among the Q newly added intent recognition samples; then, based on the above-mentioned keyword level information, P second candidate recognition samples are determined among the Y initial newly added recognition samples (that is, each second candidate recognition sample contains at least one target keyword); Y is an integer greater than 1.
[0095] The above-mentioned P second candidate recognition samples are obtained by performing keyword matching and semantic change identification on Q new intent recognition samples. Each second candidate recognition sample contains at least one target keyword and the target confidence is greater than the preset threshold; among them, the order of execution of keyword matching and semantic change identification can be set according to actual needs.
[0096] S114, based on the target keyword in the second candidate recognition sample, the second candidate recognition sample is marked with prompt information to obtain a second target recognition sample; wherein the second target recognition sample includes the corresponding second candidate recognition sample and the prompt information of the corresponding target keyword.
[0097] Each second target recognition sample corresponds to a second candidate recognition sample. The second target recognition sample is based on the corresponding second candidate recognition sample and adds prompt information about at least one target keyword in the second candidate recognition sample. Specifically, the process of marking prompt information for the second candidate recognition sample can refer to the above-mentioned process of marking prompt information for the first candidate recognition sample, and will not be repeated here.
[0098] The above S108, generating a target sample data set based on the first target recognition samples corresponding to each first candidate recognition sample, specifically includes:
[0099] S1082, generating a target sample data set based on the first target recognition sample corresponding to each first candidate recognition sample and the second target recognition sample corresponding to each second candidate recognition sample; wherein the above-mentioned target sample data set is used to train the intent recognition model, and the above-mentioned intent recognition model increases the attention level of the corresponding target keyword based on the prompt information in each target recognition sample.
[0100] The above-mentioned target sample data set includes the first target recognition samples corresponding to the M first candidate recognition samples, and the true label of each first target recognition sample; the above-mentioned target sample data set also includes the second target recognition samples corresponding to the P second candidate recognition samples, and the true label of each second target recognition sample; the true label represents whether there is a specific intention; the true label of the second target recognition sample is determined based on the true label of the corresponding second candidate recognition sample and the corresponding semantic recognition result; specifically, the second target recognition sample, the second candidate recognition sample, and the newly added intention recognition sample (that is, obtained by data enhancement of the first candidate recognition sample) correspond to each other, therefore, the true label of the second target recognition sample can be determined based on the true label of the original intention recognition sample corresponding to the first candidate recognition sample and the corresponding semantic recognition result (that is, the recognition result representing whether the semantics of the first candidate recognition sample and the newly added intention recognition sample are the same).
[0101] Since the second target recognition sample not only includes the corresponding second candidate recognition sample (that is, the newly added intention recognition sample corresponding to a first candidate recognition sample), but also includes prompt information about at least one target keyword in the second candidate recognition sample, the intention recognition model can combine the keyword prompt information in the second target recognition sample to determine which keywords in the second candidate recognition sample belong to the target keywords that need special attention, thereby focusing more attention on the target keyword, increasing the attention score of the target keyword, and increasing the weight of the word vector of the target keyword, so that the intention recognition model can increase the attention level of the corresponding target keyword based on the prompt information in the target recognition sample, which can provide more effective guidance to the intention recognition model and thereby improve the training accuracy of the model parameters.
[0102] For the process of data enhancement of the first candidate recognition sample, in order to obtain more valuable new intent recognition samples as much as possible, thereby obtaining more valuable target recognition samples, therefore, the data enhancement processing is that the specific keywords that are blocked can be preset keywords with a relatively high level in the above-mentioned preset keyword vocabulary, or preset negative words in the preset negative word vocabulary, so that the multiple new intent recognition samples corresponding to a first candidate recognition sample not only include the new intent recognition samples with the same true label as the first candidate recognition sample; wherein, if the true label of the first candidate recognition sample is to have a specific intent, then the true label of the new intent recognition sample is to have a specific intent, that is, a positive sample; if the true label of the first candidate recognition sample is not to have a specific intent, then the true label of the new intent recognition sample is not to have a specific intent, that is, a negative sample; the multiple new intent recognition samples corresponding to a first candidate recognition sample also include new intent recognition samples that are opposite to the true label of the first candidate recognition sample; wherein, if the first candidate recognition sample If the true label of the other sample is to have a specific intention, then the true label of the newly added intent recognition sample is not to have a specific intention, that is, a negative sample; if the true label of the first candidate recognition sample is not to have a specific intention, then the true label of the newly added intent recognition sample is to have a specific intention, that is, a positive sample; in this way, more difficult-to-recognize samples that are similar but opposite to the true label can be obtained, and therefore, the intent recognition model can be prompted to learn the differences between multiple approximate samples, that is, to learn how to distinguish the true label boundaries of positive samples and negative samples in multiple approximate samples, so that the intent recognition model has the ability to accurately distinguish which of the multiple approximate samples has a specific intention and which does not have a specific intention; since the positive sample and the negative sample may be obtained by data enhancement of the same first candidate sample, the positive sample and the negative sample are relatively similar, and the difficulty of distinguishing between the two is high, which helps the model to better learn the positive and negative sample boundaries. Based on this, the above S110 performs data enhancement processing based on the above M first candidate recognition samples to generate a new sample data set, specifically including:
[0103] Step 1: Perform occlusion processing on the specific keywords in the first candidate recognition sample to obtain the corresponding recognition sample for the intended purpose to be completed; wherein the specific keywords are keywords that meet the preset keyword occlusion constraint conditions.
[0104] The specific keyword in the above-mentioned first candidate recognition sample can be the above-mentioned target keyword, or it can be a specified keyword randomly selected from multiple specified keywords of the first candidate recognition sample. The specified keyword can be any preset keyword in the preset keyword vocabulary, or it can be any preset negative word in the preset negative word vocabulary.
[0105] If the above-mentioned specific keyword is any of the above-mentioned target keywords, the first candidate recognition sample can be directly subjected to keyword masking processing based on the keyword matching result obtained in the above-mentioned step S104 (that is, at least one target keyword in the determined first candidate recognition sample), without the need to continue to perform keyword matching; if the above-mentioned specific keyword is a specified keyword randomly selected from multiple specified keywords, it is necessary to continue to perform keyword matching on the first candidate recognition sample based on the keyword hierarchy information on the basis of the keyword matching result in the above-mentioned step S104, so as to determine all keywords related to the specific intent in the first candidate recognition sample; and determine all negative keywords in the first candidate recognition sample based on the preset negative word library; and then randomly select a specified keyword from the multiple specified keywords of the first candidate recognition sample as a specific keyword, and mask the specific keyword to obtain the corresponding recognition sample for the intent to be completed.
[0106] The above detailed explanation is given using the example of the object of data enhancement being M first candidate recognition samples. Since the specific keywords to be blocked can also be preset negative words, the preset negative words may not belong to the preset keyword vocabulary. Therefore, the objects of data enhancement can also include original intent recognition samples that do not contain target keywords, that is, the objects of data enhancement can be N original intent recognition samples; specifically, the first category of keywords belonging to the preset keyword vocabulary and the second category of keywords belonging to the preset negative word vocabulary in the original intent recognition samples can be determined respectively, and any first category keyword or second category keyword can be blocked to obtain the corresponding intent recognition sample to be completed.
[0107] Step 2: Complete the above-mentioned intent recognition samples to be completed to obtain new intent recognition samples.
[0108] The keyword completion process can be based on manual participation to complete the samples to be identified as completion intent, or it can be automatically completed using a pre-trained model. Specifically, it includes:
[0109] The above-mentioned intention recognition sample to be completed is input into the first pre-trained model to predict the words to be completed at the vacant positions in the above-mentioned intention recognition sample to be completed; based on the above-mentioned words to be completed, the above-mentioned intention recognition sample to be completed is completed to obtain a new intention recognition sample; wherein, the first pre-trained model can be a T5 model (Transfer Text-to-Text Transformer) or other neural network models that can complete sentences.
[0110] Step three: Generate a new sample data set based on the new intent recognition sample corresponding to at least one first candidate recognition sample.
[0111] Data enhancement processing can be performed on all first candidate recognition samples, or only on some first candidate recognition samples. The specific selection can be set according to actual needs, and this application does not limit this.
[0112] Regarding the process of obtaining more valuable target samples through data augmentation, based on Figure 2b above, as shown in Figure 4, taking the data augmentation objects as M first candidate recognition samples as an example, a specific implementation process of a method for generating intent recognition samples is given. The generation process of the second target recognition sample mainly includes:
[0113] (1) For M first candidate recognition samples, keyword masking processing is performed on specific keywords in the first candidate recognition samples to obtain corresponding user sentence samples to be completed; for example, user sentence samples 1 to M to be completed; wherein the specific keywords are target keywords or preset negative words.
[0114] (2) Inputting the above-mentioned user sentence samples to be completed into the first pre-training model, predicting the words to be completed at the vacant positions in the above-mentioned user sentence samples to be completed; and completing the above-mentioned user sentence samples to be completed based on the above-mentioned words to be completed to obtain new user sentence samples; for example, the new user sentence samples corresponding to the user sentence sample to be completed 1 include new user sentence samples 11 to new user sentence samples 1 i , the newly added user sentence samples corresponding to the to-be-completed user sentence sample M include newly added user sentence samples M1 to newly added user sentence samples M j , i and j are both integers greater than 1, i represents the number of new user sentence samples corresponding to the user sentence sample 1 to be completed, and j represents the number of new user sentence samples corresponding to the user sentence sample M to be completed.
[0115] (3) Based on the newly added user sentence samples corresponding to the M first candidate recognition samples, a newly added sample data set is generated; wherein the newly added sample data set includes Q newly added user sentence samples.
[0116] (4) Perform keyword matching based on the keyword hierarchy information of the preset keyword vocabulary to determine P second candidate recognition samples in the above Q new user sentence samples, and the target keyword with the highest hierarchy in each second candidate recognition sample; wherein P is an integer greater than 1 and less than Q; for example, second candidate recognition sample 1 to second candidate recognition sample P.
[0117] (5) For each second candidate recognition sample, based on the corresponding target keyword, the second candidate recognition sample is marked with prompt information to obtain a second target recognition sample; the second target recognition sample includes the corresponding second candidate recognition sample and the prompt information of the corresponding target keyword; for example, second target recognition sample 1 to second target recognition sample P.
[0118] After generating M first target recognition samples and P second target recognition samples, a target sample dataset is generated based on the M first target recognition samples and the P second target recognition samples; wherein the above target sample dataset is used to train the intent recognition model, and the above intent recognition model increases the attention level of the corresponding target keyword based on the prompt information in each target recognition sample.
[0119] The process of determining P second candidate recognition samples based on Q new intent recognition samples involves filtering out new intent recognition samples that do not contain keywords in combination with keyword matching, and filtering out new intent recognition samples with low target confidence in combination with the recognition results of whether the semantics have changed. These two new sample screening processes, taking into account the relatively high efficiency of keyword matching, first perform keyword matching on the Q new intent recognition samples to filter out new intent recognition samples that do not contain keywords; then perform semantic change recognition on the remaining new intent recognition samples, and based on the semantic recognition results, filter out new intent recognition samples with low target confidence, thereby obtaining P second candidate recognition samples whose target confidence is greater than a preset threshold and include at least one preset keyword; specifically, as shown in Figure 5, the above step S112, based on the above Q new intent recognition samples and the above keyword level information, determines P second candidate recognition samples, specifically including:
[0120] S1122 : Based on the keyword level information, select X initial candidate recognition samples from the Q newly added intent recognition samples.
[0121] Each initial candidate recognition sample includes at least one target keyword that satisfies the above-mentioned preset keyword level constraint conditions; X is an integer greater than 1, X is less than Q and greater than P; specifically, X initial candidate recognition samples are selected from the Q newly added intent recognition samples. The specific implementation process can refer to the screening process of the first candidate recognition sample mentioned above and will not be repeated here.
[0122] S1124, input the above-mentioned initial candidate recognition sample and the first candidate recognition sample corresponding to the initial candidate recognition sample into the second pre-training model for semantic recognition, and obtain the semantic recognition result of the initial candidate recognition sample; wherein, the semantic recognition result includes a target confidence level that characterizes whether the semantics of the initial candidate recognition sample has changed.
[0123] The above-mentioned second pre-trained model is the above-mentioned preset semantic recognition model, which can be a BERT-based text binary classification model, or other pre-trained semantic recognition models; the above-mentioned semantic recognition result can specifically include a first probability representing that the semantics of the two are the same (that is, the semantics remain unchanged) and a second probability representing that the semantics of the two are different (that is, the semantics change). Correspondingly, the above-mentioned target confidence can be the maximum value of the first probability and the second probability; specifically, if the first probability is greater than the second probability, it means that the initial candidate recognition sample and the corresponding first candidate recognition sample have the same semantics; if the second probability is greater than the first probability, it means that the initial candidate recognition sample and the corresponding first candidate recognition sample have different semantics.
[0124] S1126 , based on the target confidence of each initial candidate recognition sample, determine P second candidate recognition samples whose target confidence is greater than a preset threshold among the X initial candidate recognition samples.
[0125] For a certain initial candidate recognition sample, if the target confidence is less than the preset threshold, it means that the maximum value of the first probability and the second probability is relatively small, that is, the first probability and the second probability are not much different. Therefore, the semantics of the initial candidate recognition sample and the corresponding first candidate recognition sample are not distinguished by the degree of being the same or different. In other words, the initial candidate recognition sample belongs to a sample with low target confidence, resulting in a low accuracy of determining the true label of the initial candidate recognition sample based on the semantic recognition result. Therefore, such initial candidate recognition samples with low target confidence can be screened out to avoid affecting the training accuracy of the model parameters due to the low accuracy of their true labels, and only the new samples with relatively high target confidence are used as the target samples for the final model training.
[0126] In some example embodiments, the true labels of the second target recognition samples may be manually annotated. To improve the labeling efficiency of the second target recognition samples, in the case of introducing semantic change recognition for the second candidate recognition samples, the true labels of the second candidate recognition samples may be determined with the help of semantic recognition results, and then the true labels of the second target recognition samples may be determined. This eliminates the need for manually annotating the true labels of the newly added samples. Based on this, in step S1082, before generating the target sample dataset based on the first target recognition samples corresponding to each first candidate recognition sample and the second target recognition samples corresponding to each second candidate recognition sample, the following steps may be further included:
[0127] Step 1: Determine the true label of the second candidate recognition sample based on the target confidence of the initial candidate recognition sample corresponding to the second candidate recognition sample and the true label of the first candidate recognition sample corresponding to the second candidate recognition sample.
[0128] There is a certain correspondence between the above-mentioned original intent recognition sample, the first candidate recognition sample (i.e., the original intent recognition sample containing at least one target keyword), the newly added intent recognition sample (i.e., obtained by data enhancement of a first candidate recognition sample, the data enhancement process may cause the semantics of the newly added sample to change), the initial candidate recognition sample (i.e., the newly added intent recognition sample containing at least one target keyword), and the second candidate recognition sample (i.e., the initial candidate recognition sample with a target confidence greater than a preset threshold); the first candidate recognition sample corresponds one-to-one to the first target recognition sample, and the second candidate recognition sample corresponds one-to-one to the second target recognition sample; combined with whether the target confidence of the initial candidate recognition sample is equal to the first probability or the second probability, it can be determined whether the semantics of the initial candidate recognition sample and the corresponding first candidate recognition sample are the same, that is, whether the semantics of the corresponding newly added intent recognition sample have changed.
[0129] Since the initial candidate recognition sample is a newly added intent recognition sample containing at least one target keyword, the second candidate recognition sample is an initial candidate recognition sample with a target confidence greater than a preset threshold, each newly added intent recognition sample corresponds to a first candidate recognition sample, and the first candidate recognition sample is an original intent recognition sample containing at least one target keyword. Therefore, based on the true label of the original intent recognition sample, the true label of the corresponding first candidate recognition sample can be determined, and then for a second candidate recognition sample, the true label of the second candidate recognition sample can be determined based on the true label of the corresponding first candidate recognition sample and the target confidence of the corresponding initial candidate recognition sample.
[0130] If the target confidence of the initial candidate recognition sample corresponding to the second candidate recognition sample is equal to the first probability (i.e., the representation semantics remain unchanged), the true label of the corresponding first candidate recognition sample is determined as the true label of the second candidate recognition sample; if the target confidence of the initial candidate recognition sample corresponding to the second candidate recognition sample is equal to the second probability (i.e., the representation semantics change), the opposite label of the true label of the corresponding first candidate recognition sample is determined as the true label of the second candidate recognition sample; wherein, if the true label is a specific intent label, then the opposite label of the specific intent label (such as a complaint intention label) is other intent labels (such as a non-complaint intention label).
[0131] Step 2: Based on the true label of the second candidate recognition sample, determine the true label of the corresponding second target recognition sample; and based on the true label of the first candidate recognition sample, determine the true label of the corresponding first target recognition sample.
[0132] Since the main difference between the target recognition sample and the corresponding candidate recognition sample is whether keyword prompt information is added, the true label of the candidate recognition sample can be directly used as the true label of the corresponding target recognition sample.
[0133] The above step S1082 generates a target sample data set based on the first target recognition sample corresponding to each first candidate recognition sample and the second target recognition sample corresponding to each second candidate recognition sample, specifically including:
[0134] A target sample data set is generated based on each first target recognition sample and its true label, and each second target recognition sample and its true label.
[0135] The above-mentioned target sample data set includes M first target recognition samples and the true label of each first target recognition sample; the above-mentioned target sample data set also includes P second target recognition samples and the true label of each second target recognition sample; wherein the true label represents whether there is a specific intention.
[0136] Regarding the process of determining P second candidate recognition samples, keyword matching is first performed based on keyword hierarchical information to filter out new intent recognition samples that do not contain keywords; then semantic changes are identified for the remaining new intent recognition samples, and based on the target confidence in the semantic recognition results, new intent recognition samples with low target confidence are filtered out, thereby obtaining new intent recognition samples that contain target keywords and have high confidence (i.e., second candidate recognition samples). Based on FIG4 above, as shown in FIG6, a specific implementation process of a method for generating intent recognition samples is given, wherein (4) in FIG4 above determines P second candidate recognition samples based on the above Q new user sentence samples and the above keyword hierarchical information; it mainly includes:
[0137] (41) Perform keyword matching based on keyword hierarchy information of a preset keyword vocabulary to determine X initial candidate recognition samples among the Q newly added user sentence samples, and the target keyword with the highest hierarchy among each initial candidate recognition sample; wherein X is an integer greater than 1 and less than Q; for example, initial candidate recognition sample 1 to initial candidate recognition sample X.
[0138] (42) Inputting the above-mentioned initial candidate recognition sample and the corresponding first candidate recognition sample into the second pre-training model for semantic recognition, and obtaining the semantic recognition result of the initial candidate recognition sample; wherein, the semantic recognition result includes a target confidence level representing whether the semantics of the initial candidate recognition sample has changed.
[0139] (43) Based on the target confidence of each initial candidate recognition sample, determine P second candidate recognition samples whose target confidence is greater than a preset threshold among the above X initial candidate recognition samples; wherein P is an integer greater than 1 and P is less than X; for example, second candidate recognition sample 1 to second candidate recognition sample P.
[0140] The method for generating intent recognition samples in the embodiment of the present application, with regard to the generation process of intent recognition samples, first, based on the keyword hierarchy information of the preset keyword vocabulary, M first candidate recognition samples (i.e., original intent recognition samples containing at least one target keyword, that is, samples that will be identified as suspicious samples with specific intent) are screened out from N original intent recognition samples; then, prompt information is marked based on the target keyword in the first candidate recognition sample to obtain the corresponding first target recognition sample, that is, the target keyword in the first candidate recognition sample is marked, so that the intent recognition model will focus more attention on the target keyword as effective guidance information in the model training stage; then, a target sample data set is generated based on the M first target recognition samples; first, the original samples that do not contain the preset keywords are filtered out in combination with the keyword hierarchy information, thereby reducing the sample space by screening out useless samples; then, the target keywords in the candidate recognition samples identified when the useless samples are screened out and the suspicious samples are retained are marked with prompt information to obtain the target recognition samples finally used for model training, which can prompt the model to quickly identify the target keywords that need special attention, thereby improving the training accuracy of the model parameters.
[0141] Corresponding to the method for generating intent recognition samples described in Figures 1 to 6 above, based on the same technical concept, an embodiment of the present application further provides an intent recognition model training method. Figure 7 is a flow chart of the intent recognition model training method provided in the embodiment of the present application. The method in Figure 7 can be executed by an electronic device provided with an intent recognition training device, which can be a terminal device or a designated server. It should be noted that based on the intent recognition model training method provided in the embodiment of the present application, the intent recognition obtained through training can be applied to any specific application scenario that requires identifying target users with specific intentions. For example, target users with complaint intentions can be screened out from a large number of first-time outbound call users to avoid secondary marketing to such users; for another example, target users with loan intentions can be screened out from a large number of candidate users to conduct precision marketing to such users; as shown in Figure 7, the method includes at least the following steps:
[0142] S702, obtaining a target sample data set; wherein the target sample data set includes a plurality of target recognition samples, each target recognition sample includes a candidate recognition sample, and prompt information of a target keyword in the candidate recognition sample.
[0143] The above-mentioned candidate recognition sample is any original intent recognition sample in the original sample data set that contains at least one target keyword; wherein, the above-mentioned target sample data set may include only the first target recognition sample, or may include the first target recognition sample and the second target recognition sample at the same time. The specific generation process of the target sample data set can refer to the generation process of the above-mentioned intent recognition sample, and will not be repeated here.
[0144] S704: Input the target sample data set into the intent recognition model to be trained to iteratively update the model parameters to obtain a trained intent recognition model; wherein the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0145] The above-mentioned intention recognition model can combine the keyword prompt information in the target recognition sample to determine which keywords in the candidate recognition sample are target keywords that need special attention, thereby focusing more attention on the target keyword, increasing the attention score of the target keyword, and increasing the weight of the word vector of the target keyword, so that the intention recognition model can increase the attention level of the corresponding target keyword based on the prompt information in the target recognition sample, which can provide more effective guidance to the intention recognition model and thus improve the training accuracy of the model parameters.
[0146] Regarding the iterative update process of model parameters, the above S704 inputs the above target sample data set into the intent recognition model to be trained to iteratively update the model parameters to obtain the trained intent recognition model, which specifically includes:
[0147] Step 1: For each target recognition sample, input the target recognition sample into the intent recognition model to be trained to obtain the initial weight sequence of the target recognition sample; wherein the initial weight sequence includes the initial weight of each word in the candidate recognition sample corresponding to the target recognition sample.
[0148] The process of determining the above-mentioned initial weight sequence can refer to relevant technologies. For example, if the intent recognition model is a BERT model, the process of assigning weights to each word in the sentence based on the attention mechanism of the BERT model can be referred to, which will not be repeated here.
[0149] Step 2: Based on the prompt information about the target keyword in the target recognition sample, the initial weight sequence is adjusted to obtain a target weight sequence.
[0150] In some example embodiments, based on the keyword prompt information in the target recognition sample, the target initial weight in the initial weight sequence (i.e., the initial weight corresponding to the target keyword) is increased according to a preset weight adjustment method; in other example embodiments, based on the keyword prompt information in the target recognition sample, the non-target initial weight in the initial weight sequence (i.e., the initial weight corresponding to other word segmentations except the target keyword) is reduced according to a preset weight adjustment method.
[0151] For example, the first target recognition sample can be expressed as "Not interested [SEP] I am not interested in your loan." Correspondingly, in some example embodiments, the initial weight corresponding to the target keyword "Not interested" in the initial weight sequence is increased according to a preset weight adjustment method; in other example embodiments, the initial weights corresponding to other word segmentations in the initial weight sequence except the target keyword "Not interested" are reduced according to a preset weight adjustment method.
[0152] Step three: Based on the target weight sequence and the word vector of each word in the candidate recognition sample, determine the text feature vector of the target recognition sample.
[0153] A weighted summation method can be adopted to obtain the text feature vector of the target recognition sample based on the word vector of each word segment in the above candidate recognition sample and the weight coefficient corresponding to each group in the above target weight sequence.
[0154] Step 4: Iteratively update the model parameters of the intent recognition model to be trained based on the text feature vectors of each target recognition sample to obtain the trained intent recognition model.
[0155] For each target recognition sample, intent recognition is performed based on the text feature vector of the target recognition sample to obtain a predicted intent label; the loss value of the target recognition sample is calculated based on the predicted intent label and the true intent label; the total loss value is determined based on the loss value of each target recognition sample; the model parameters of the intent recognition model to be trained are iteratively updated based on the total loss value to obtain the trained intent recognition model.
[0156] As shown in Figure 8, a specific implementation process of the intent recognition model training method is given, which mainly includes:
[0157] (1) Obtain a target sample data set; wherein the target sample data set includes Z target recognition samples, each target recognition sample includes a candidate recognition sample, and prompt information of the target keyword in the candidate recognition sample; for example, the target sample data set includes the first target recognition sample 1 to the first target recognition sample M, and the second target recognition sample 1 to the second target recognition sample P, then Z is equal to the sum of M and P.
[0158] (2) For each target recognition sample, the target recognition sample is input into the first network layer of the intent recognition model to be trained to obtain the initial weight sequence of the target recognition sample; and the initial weight sequence is adjusted based on the prompt information about the target keyword in the target recognition sample through the second network layer to obtain the target weight sequence; then, the text feature vector of the target recognition sample is determined based on the target weight sequence and the word vector of each word in the candidate recognition sample through the third network layer; and then, for each target recognition sample, the intent is recognized based on the text feature vector of the target recognition sample through the prediction network layer to obtain the predicted intent label.
[0159] (3) Calculate the sub-loss value of the target recognition sample based on the predicted intent label and the true intent label corresponding to the target recognition sample; determine the total loss value based on the sub-loss value of each target recognition sample; iteratively update the model parameters of the intent recognition model to be trained based on the total loss value to obtain the trained intent recognition model.
[0160] The intent recognition model training method in the embodiment of the present application, for the training process of the intent recognition model, each target recognition sample in the selected target training sample set includes not only a candidate recognition sample, but also prompt information about at least one target keyword in the candidate recognition sample; and the candidate recognition sample is not any original intent recognition sample, but an original intent recognition sample containing at least one target keyword, that is, the generation process of the target recognition sample mainly includes: first, combining the keyword hierarchical information to filter out the original samples that do not contain the preset keywords, thereby reducing the sample space by screening out useless samples; then combining the target keywords in the candidate recognition samples identified when screening out useless samples and retaining suspicious samples to perform prompt information identification, and obtain the target recognition sample finally used for model training, which can prompt the model to quickly identify the target keywords that need special attention, thereby improving the training accuracy of the model parameters.
[0161] It should be noted that this embodiment in the present application is based on the same inventive concept as the previous embodiment in the present application. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned method for generating intent recognition samples, and the repeated parts will not be repeated.
[0162] Corresponding to the method for generating intent recognition samples described in Figures 1 to 6 above, based on the same technical concept, an embodiment of the present application further provides an intent recognition method. Figure 9a is a flow chart of the intent recognition method provided in the embodiment of the present application. The method in Figure 9a can be executed by an electronic device provided with an intent recognition device, which can be a terminal device or a designated server. It should be noted that the intent recognition method provided in the embodiment of the present application can be applied to any specific application scenario that requires identifying target users with specific intentions. For example, using a pre-trained intent recognition model, target users with complaint intentions can be screened out from a large number of first-time outbound call users to avoid secondary marketing to such users; for another example, using a pre-trained intent recognition model, target users with loan intentions can be screened out from a large number of candidate users to conduct precision marketing to such users; as shown in Figure 9a, the method includes at least the following steps:
[0163] S400 , determining target keywords in the original text sentence to be recognized based on keyword hierarchy information of a preset keyword vocabulary; the target keywords are keywords that meet the constraint conditions corresponding to the keyword hierarchy information.
[0164] S500, based on the target keywords, marking prompt information on the original text sentence to obtain the target text sentence;
[0165] S600: Input the target text sentence into the trained intent recognition model to perform intent recognition and obtain an intent recognition result; the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0166] In some example embodiments, as shown in FIG9b , the method for generating an intent recognition sample includes at least the following steps:
[0167] S902, obtaining original text sentences of the user to be identified with intent; wherein the original text sentences may be from an original text dataset, wherein the original text dataset includes R customer text sentences in the conversation content between the agent and the user to be identified with intent, wherein the user to be identified with intent is a user for whom it is necessary to determine whether he or she has a specific intent, and R is an integer greater than 1.
[0168] S904 : Determine at least one target keyword in the original text sentence to be recognized based on keyword hierarchy information of a preset keyword vocabulary; wherein the target keyword is a keyword that meets a preset keyword hierarchy constraint condition.
[0169] The above-mentioned original text sentence to be identified can be an original text sentence containing at least one target keyword from the R original text sentences; specifically, the process of selecting the original text sentence to be identified from the R original text sentences and determining at least one target keyword in the original text sentence can refer to the selection process of the first candidate recognition sample mentioned above, and will not be repeated here.
[0170] S906 , based on the target keyword, marking the original text sentence with prompt information to obtain a target text sentence; wherein the target text sentence includes the original text sentence and the prompt information of the target keyword.
[0171] The process of marking the keyword prompt information of the original text sentence to be recognized can refer to the process of marking the keyword prompt information of the first candidate recognition sample mentioned above, and will not be repeated here.
[0172] S908, input the above-mentioned target text sentence into the trained intent recognition model for intent recognition, and obtain the intent recognition result corresponding to the target text sentence; wherein, the intent recognition model increases the attention level of the above-mentioned target keyword based on the above-mentioned prompt information.
[0173] The above intention recognition result includes a predicted probability that represents whether the user to be identified has a specific intention.
[0174] Regarding the process of performing intent recognition based on the target text sentence, in S908, the target text sentence is input into the trained intent recognition model for intent recognition, and the intent recognition result corresponding to the target text sentence is obtained, which specifically includes:
[0175] Step 1: Input the above target text sentence into the trained intent recognition model to obtain an initial weight sequence of the target text sentence; wherein, the initial weight sequence includes the initial weight of each word in the above original text sentence.
[0176] The process of determining the above-mentioned initial weight sequence can refer to relevant technologies. For example, if the intent recognition model is a BERT model, the process of assigning weights to each word in the sentence based on the attention mechanism of the BERT model can be referred to, which will not be repeated here.
[0177] Step 2: Based on the prompt information about the target keyword in the target text sentence, the initial weight sequence is adjusted to obtain a target weight sequence.
[0178] The adjustment process of the initial weight sequence of the target text sentence can refer to the adjustment process of the initial weight sequence corresponding to the above-mentioned target recognition sample, and will not be repeated here.
[0179] Step three: Based on the target weight sequence and the word vectors of each word in the original text sentence, determine the text feature vector of the target text sentence.
[0180] A weighted summation method can be adopted to obtain the text feature vector of the target text sentence based on the word vector of each word segment in the above original text sentence and the weight coefficient corresponding to each group in the above target weight sequence.
[0181] Step 4: Perform intent recognition based on the text feature vector of the target text sentence to obtain the intent recognition result corresponding to the target text sentence.
[0182] For the target text sentence, the text feature vector of the target text sentence is input into the prediction network layer of the intent recognition model for intent recognition. The output of the prediction network layer is the intent recognition result corresponding to the target text sentence; wherein, the intent recognition result includes a predicted intent label that characterizes whether the user to be identified has a specific intention.
[0183] As shown in Figure 10, a specific implementation process of the intent recognition method is given, which mainly includes:
[0184] (1) Obtain K original text sentences corresponding to the users to be identified; wherein K is an integer greater than 1; for example, original text sentence 1 to original text sentence K.
[0185] (2) Based on the keyword hierarchy information of the preset keyword vocabulary, determine the target keyword with the highest hierarchy in the above original text sentence; for example, the target keyword with the highest hierarchy in original text sentence 1 is target keyword 1, and the target keyword with the highest hierarchy in original text sentence K is target keyword K.
[0186] (3) Based on the target keyword, the original text sentence is marked with prompt information to obtain a target text sentence; for example, target text sentence 1 to target text sentence K, wherein the target text sentence includes the original text sentence and the prompt information of the target keyword.
[0187] (4) The target text sentence is input into the first network layer of the trained intent recognition model to obtain the initial weight sequence of the target text sentence; and the initial weight sequence is adjusted based on the prompt information about the target keyword in the target text sentence through the second network layer to obtain the target weight sequence; then, the text feature vector of the target text sentence is determined based on the target weight sequence and the word vector of each word in the original text sentence through the third network layer; and then, the intent is recognized based on the text feature vector of the target text sentence for each target text sentence through the prediction network layer to obtain a predicted intent label.
[0188] (5) Based on the predicted intention labels corresponding to each user to be identified, determine whether the user to be identified is a target user; if the predicted intention label represents a specific intention, then determine that the user to be identified is a target user, thereby screening J target users from the K users to be identified; J is an integer greater than or equal to 0 and less than K.
[0189] The intent recognition method in the embodiment of the present application, in the process of intent recognition, on the one hand, also first determines the target keyword in the original text sentence in combination with the keyword hierarchy information, and then marks the original text sentence with prompt information based on the target keyword to obtain the target text sentence; then the target text sentence is used as the input of the pre-trained intent recognition model to perform intent recognition, so that the intent recognition model can quickly identify the target keywords that need special attention, thereby improving the accuracy of intent recognition; on the other hand, each target recognition sample in the target training sample set selected when training the intent recognition model includes not only a candidate recognition sample, but also prompt information about at least one target keyword in the candidate recognition sample; and the candidate recognition sample is not any original intent recognition sample, but an original intent recognition sample containing at least one target keyword, so that the parameter accuracy of the intent recognition model is relatively high, thereby further improving the accuracy of intent recognition.
[0190] It should be noted that this embodiment in the present application is based on the same inventive concept as the previous embodiment in the present application. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned method for generating intent recognition samples, and the repeated parts will not be repeated.
[0191] Corresponding to the method for generating intent recognition samples described in Figures 1 to 6 above, based on the same technical concept, an embodiment of the present application also provides a device for generating intent recognition samples. Figure 11 is a schematic diagram of the module composition of the device for generating intent recognition samples provided in an embodiment of the present application. The device is used to execute the method for generating intent recognition samples described in Figures 1 to 6. As shown in Figure 11, the device includes: a candidate sample set acquisition module 1102, which is used to determine the first candidate recognition sample from multiple original intent recognition samples based on the keyword hierarchy information of a preset keyword vocabulary; each of the first candidate recognition samples includes at least one target keyword that meets the corresponding constraint conditions of the keyword hierarchy information; a keyword prompt marking module 1104, which is used to mark the prompt information of the first candidate recognition sample based on the target keyword to obtain a first target recognition sample; a target sample set generation module 1106, which is used to generate a target sample data set based on the first target recognition sample; the target sample data set is used to train the intent recognition model, and the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0192] In some example embodiments, the above-mentioned intent recognition sample generation device includes: an original sample set acquisition module, used to obtain an original sample data set; the original sample data set includes N original intent recognition samples; a candidate sample set acquisition module, used to determine M first candidate recognition samples among the N original intent recognition samples based on the keyword hierarchy information of a preset keyword vocabulary; each of the first candidate recognition samples includes at least one target keyword that meets the preset keyword hierarchy constraint condition; M and N are both integers greater than 1 and M is less than N; a keyword prompt marking module 1106, used to mark the first candidate recognition sample with prompt information based on the target keyword to obtain a first target recognition sample; the first target recognition sample includes the first candidate recognition sample and the prompt information of the target keyword; a target sample set generation module, used to generate a target sample data set based on the first target recognition sample corresponding to each of the first candidate recognition samples; the target sample data set is used to train an intent recognition model, and the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0193] The device for generating intention recognition samples in the embodiment of the present application, with respect to the generation process of intention recognition samples, first screens out M first candidate recognition samples (i.e., original intention recognition samples containing at least one target keyword, which will be identified as suspicious samples with specific intentions) from N original intention recognition samples based on the keyword hierarchy information of the preset keyword vocabulary; then marks prompt information based on the target keyword in the first candidate recognition sample to obtain the corresponding first target recognition sample, that is, marks the target keyword in the first candidate recognition sample, so that the intention recognition model will focus more attention on the target keyword as effective guidance information in the model training stage; then generates a target sample data set based on the M first target recognition samples; first filters out the original samples that do not contain the preset keywords in combination with the keyword hierarchy information, thereby reducing the sample space by screening out useless samples; then marks prompt information based on the target keyword in the candidate recognition sample identified when screening out useless samples and retaining suspicious samples, and obtains the target recognition sample finally used for model training, which can prompt the model to quickly identify the target keywords that need special attention, thereby improving the training accuracy of the model parameters.
[0194] It should be noted that the embodiment of the device for generating intent recognition samples in this application and the embodiment of the method for generating intent recognition samples in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding method for generating intent recognition samples mentioned above, and the repeated parts will not be repeated.
[0195] Corresponding to the intention recognition model training method described in Figures 7 to 8 above, based on the same technical concept, an embodiment of the present application also provides an intention recognition model training device. Figure 12 is a schematic diagram of the module composition of the intention recognition model training device provided in an embodiment of the present application. The device is used to execute the intention recognition model training method described in Figures 7 to 8. As shown in Figure 12, the device includes: a target sample set acquisition module 1202, used to acquire a target sample data set; the target sample data set includes multiple target recognition samples, each of the target recognition samples includes a candidate recognition sample, and prompt information of the target keyword in the candidate recognition sample; an intention recognition model training module 1204, used to input the target sample data set into the intention recognition model to be trained for iterative update of model parameters to obtain a trained intention recognition model; the intention recognition model increases the attention level of the target keyword based on the prompt information.
[0196] In the intention recognition model training device in the embodiment of the present application, for the training process of the intention recognition model, each target recognition sample in the selected target training sample set includes not only a candidate recognition sample, but also prompt information about at least one target keyword in the candidate recognition sample; and the candidate recognition sample is not any original intention recognition sample, but an original intention recognition sample containing at least one target keyword, that is, the generation process of the target recognition sample mainly includes: first, combining the keyword hierarchical information to filter out the original samples that do not contain the preset keywords, thereby reducing the sample space by screening out useless samples; then combining the target keywords in the candidate recognition samples identified when screening out useless samples and retaining suspicious samples to perform prompt information identification, and obtain the target recognition sample finally used for model training, which can prompt the model to quickly identify the target keywords that need special attention, thereby improving the training accuracy of the model parameters.
[0197] It should be noted that the embodiment of the intent recognition model training device in this application and the embodiment of the intent recognition model training method in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding intent recognition model training method mentioned above, and the repeated parts will not be repeated.
[0198] Corresponding to the intention recognition method described in Figures 9a to 10 above, based on the same technical concept, an embodiment of the present application also provides an intention recognition device. Figure 13 is a schematic diagram of the module composition of the intention recognition device provided in the embodiment of the present application. The device is used to execute the intention recognition method described in Figures 9a to 10. As shown in Figure 13, the device includes: a keyword determination module 1302, which is used to determine the target keyword in the original text sentence to be identified based on the keyword hierarchy information of a preset keyword vocabulary; the target keyword is a keyword that meets the corresponding constraint conditions of the keyword hierarchy information; a keyword prompt marking module 1304, which is used to mark the original text sentence with prompt information based on the target keyword to obtain a target text sentence; an intention recognition module 1306, which is used to input the target text sentence into the trained intention recognition model for intention recognition to obtain an intention recognition result; the intention recognition model increases the attention level of the target keyword based on the prompt information.
[0199] In some example embodiments, the above-mentioned intention recognition device includes: an original sentence acquisition module, which is used to obtain the original text sentence of the user to be intended for recognition; a keyword determination module, which is used to determine at least one target keyword in the original text sentence to be recognized based on the keyword hierarchy information of a preset keyword vocabulary; the target keyword is a keyword that meets the preset keyword hierarchy constraint condition; a keyword prompt marking module, which is used to mark the original text sentence with prompt information based on the target keyword to obtain a target text sentence; the target text sentence includes the original text sentence and the prompt information of the target keyword; an intention recognition module, which is used to input the target text sentence into the trained intention recognition model for intent recognition to obtain the intention recognition result corresponding to the target text sentence; the intention recognition model increases the attention level of the target keyword based on the prompt information.
[0200] The intent recognition device in the embodiment of the present application, during the process of intent recognition, on the one hand, also first determines the target keyword in the original text sentence in combination with the keyword hierarchy information, and then marks the original text sentence with prompt information based on the target keyword to obtain the target text sentence; then the target text sentence is used as the input of the pre-trained intent recognition model to perform intent recognition, so that the intent recognition model can quickly identify the target keywords that need special attention, thereby improving the accuracy of intent recognition; on the other hand, each target recognition sample in the target training sample set selected when training the intent recognition model includes not only a candidate recognition sample, but also prompt information about at least one target keyword in the candidate recognition sample; and the candidate recognition sample is not any original intent recognition sample, but an original intent recognition sample containing at least one target keyword, so that the parameter accuracy of the intent recognition model is relatively high, thereby further improving the accuracy of intent recognition.
[0201] It should be noted that the embodiment of the intention recognition device in this application and the embodiment of the intention recognition method in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding intention recognition method mentioned above, and the repeated parts will not be repeated.
[0202] Corresponding to the methods shown in Figures 1 to 10 above, based on the same technical concept, an embodiment of the present application also provides a computer device, which is used to execute the above-mentioned intent recognition sample generation method, intent recognition model training method or intent recognition method, as shown in Figure 14.
[0203] Computer devices may vary significantly due to different configurations or performance, and may include one or more processors 1401 and memory 1402. The memory 1402 may store one or more applications or data. Memory 1402 may be either short-term or persistent storage. Applications stored in memory 1402 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for the computer device. Furthermore, processor 1401 may be configured to communicate with memory 1402 to execute the series of computer-executable instructions in memory 1402 on the computer device. The computer device may also include one or more power supplies 1403, one or more wired or wireless network interfaces 1404, one or more input / output interfaces 1405, one or more keyboards 1406, and the like.
[0204] The computer device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions in the computer device, and is configured to be executed by one or more processors. The one or more programs include the following computer-executable instructions: based on the keyword hierarchy information of a preset keyword vocabulary, determine a first candidate recognition sample among multiple original intent recognition samples; the first candidate recognition sample includes at least one target keyword that meets the constraint conditions corresponding to the keyword hierarchy information; based on the target keyword, mark the first candidate recognition sample with prompt information to obtain a first target recognition sample; based on the first target recognition sample, generate a target sample data set; the target sample data set is used to train an intent recognition model, and the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0205] The computer device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions in the computer device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following: obtaining a target sample data set; the target sample data set includes multiple target recognition samples, each of the target recognition samples includes a candidate recognition sample, and prompt information of the target keyword in the candidate recognition sample; inputting the target sample data set into the intent recognition model to be trained to iteratively update the model parameters to obtain the trained intent recognition model; the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0206] The computer device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions in the computer device, and is configured to be executed by one or more processors. The one or more programs include instructions for performing the following computer-executable instructions: based on the keyword hierarchy information of a preset keyword vocabulary, determining the target keyword in the original text sentence to be identified; the target keyword is a keyword that meets the constraint conditions corresponding to the keyword hierarchy information; based on the target keyword, marking the original text sentence with prompt information to obtain a target text sentence; inputting the target text sentence into the trained intent recognition model for intent recognition to obtain an intent recognition result; the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0207] The computer device in the embodiment of the present application, for the generation process of the intent recognition sample, firstly screens out M first candidate recognition samples (i.e., original intent recognition samples containing at least one target keyword, i.e., samples that will be identified as suspicious samples with specific intent) from N original intent recognition samples based on the keyword hierarchy information of the preset keyword vocabulary; then, based on the target keyword in the first candidate recognition sample, prompt information is marked to obtain the corresponding first target recognition sample, i.e., the target keyword in the first candidate recognition sample is marked, so that the intent recognition model will focus more on the target keyword as effective guidance information in the model training stage; then, a target sample data set is generated based on the M first target recognition samples; first, the target keyword is combined with the target keyword to generate a target sample data set; The keyword-level information filters out the original samples that do not contain the preset keywords, thereby reducing the sample space by screening out useless samples; then, the target keywords in the candidate recognition samples identified when the useless samples are screened out and the suspicious samples are retained are combined to perform prompt information identification, and the target recognition samples finally used for model training are obtained. This can prompt the model to quickly identify the target keywords that need special attention, thereby improving the training accuracy of the model parameters; and, in the intent recognition process, on the one hand, prompt information about at least one corresponding target keyword is also added to the original text sentence, and on the other hand, the intent recognition model trained based on the above-mentioned target sample data set is used to perform intent recognition, which can further improve the accuracy of user intent recognition.
[0208] It should be noted that the embodiment of the computer device in this application and the embodiment of the method for generating intent recognition samples in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding method for generating intent recognition samples mentioned above, and the repetitive parts will not be repeated.
[0209] Corresponding to the methods shown in Figures 1 to 10 above, based on the same technical concept, an embodiment of the present application also provides a storage medium for storing computer-executable instructions. The storage medium can be a U disk, an optical disk, a hard disk, etc. When the computer-executable instructions stored in the storage medium are executed by the processor, the following process can be implemented: based on the keyword hierarchy information of the preset keyword vocabulary, a first candidate recognition sample is determined among multiple original intent recognition samples; the first candidate recognition sample includes at least one target keyword that meets the constraint conditions corresponding to the keyword hierarchy information; based on the target keyword, prompt information is marked on the first candidate recognition sample to obtain a first target recognition sample; based on the first target recognition sample, a target sample data set is generated; the target sample data set is used to train the intent recognition model, and the intent recognition model increases the attention level of the target keyword based on the prompt information.
[0210] The above-mentioned storage medium can be a USB flash drive, a CD, a hard disk, etc. The computer executable instructions stored in the storage medium can implement the following process when executed by the processor: obtain a target sample data set; the target sample data set includes multiple target recognition samples, each of the target recognition samples includes a candidate recognition sample, and prompt information of the target keyword in the candidate recognition sample; the target sample data set is input into the intention recognition model to be trained to iteratively update the model parameters to obtain the trained intention recognition model; the intention recognition model increases the attention level of the target keyword based on the prompt information.
[0211] The above-mentioned storage medium can be a U disk, a CD, a hard disk, etc. The computer executable instructions stored in the storage medium can implement the following process when executed by the processor: based on the keyword hierarchy information of the preset keyword vocabulary, determine the target keyword in the original text sentence to be identified; the target keyword is a keyword that meets the corresponding constraint conditions of the keyword hierarchy information; based on the target keyword, mark the prompt information on the original text sentence to obtain the target text sentence; input the target text sentence into the trained intention recognition model for intention recognition to obtain the intention recognition result; the intention recognition model increases the attention level of the target keyword based on the prompt information.
[0212] When the computer executable instructions stored in the storage medium in the embodiment of the present application are executed by the processor, for the generation process of the intent recognition sample, first, based on the keyword hierarchy information of the preset keyword vocabulary, M first candidate recognition samples (that is, original intent recognition samples containing at least one target keyword, that is, suspicious samples that will be identified as having a specific intent) are screened out from N original intent recognition samples; then, prompt information is marked based on the target keyword in the first candidate recognition sample to obtain the corresponding first target recognition sample, that is, the target keyword in the first candidate recognition sample is marked, so that the intent recognition model will focus more on the target keyword as effective guidance information in the model training stage; then, a target sample data set is generated based on the M first target recognition samples; first, the keyword hierarchy information is combined to pass the Filter out the original samples that do not contain the preset keywords, thereby reducing the sample space by screening out useless samples; then combine the target keywords in the candidate recognition samples identified when screening out useless samples and retaining suspicious samples to perform prompt information identification, and obtain the target recognition samples finally used for model training, which can prompt the model to quickly identify the target keywords that need special attention, thereby improving the training accuracy of the model parameters; and in the intent recognition process, on the one hand, first add prompt information about at least one corresponding target keyword to the original text sentence, and on the other hand, use the intent recognition model trained based on the above-mentioned target sample data set to perform intent recognition, which can further improve the accuracy of user intent recognition.
[0213] It should be noted that the embodiment of the storage medium in this application and the embodiment of the method for generating intent recognition samples in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding method for generating intent recognition samples mentioned above, and the repeated parts will not be repeated.
[0214] The foregoing description describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0215] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the application can adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0216] The present application is described with reference to the flow chart and / or block diagram according to the method, equipment (system) and computer program product of embodiment of the present application.It should be understood that each flow process and / or box in flow chart and / or block diagram and the combination of flow process and / or box in flow chart and / or block diagram can be realized by computer program instruction.These computer program instructions can be provided to the processor of general-purpose computer, special-purpose computer, embedded processing machine or other programmable data processing equipment to produce a machine, so that the instruction executed by the processor of computer or other programmable data processing equipment produces the device for realizing the function specified in flow chart one flow process or multiple flow processes and / or block diagram one box or multiple boxes.These computer program instructions can also be stored in the computer-readable memory that can guide computer or other programmable data processing equipment to work in a special way, so that the instruction stored in this computer-readable memory produces the product of manufacture comprising instruction device, and this instruction device realizes the function specified in flow chart one flow process or multiple flow processes and / or block diagram one box or multiple boxes.
[0217] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0218] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-permanent storage in a computer-readable medium, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0219] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves. It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0220] The embodiments of the present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices. The various embodiments in the present application are described in a progressive manner, and the same and similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0221] The foregoing description is merely an example of the present invention and is not intended to limit the present invention. Persons skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be included within the scope of the claims herein.
Claims
1. A method for generating an intent recognition sample, the method include: Determine a first candidate recognition sample among a plurality of original intent recognition samples based on keyword level information of a preset keyword vocabulary; The first candidate recognition sample includes at least one target keyword that satisfies the constraint condition corresponding to the keyword level information; Based on the target keyword, marking prompt information on the first candidate recognition sample to obtain a first target recognition sample; Based on the first target recognition sample, generate a target sample data set; The target sample data set is used to train an intention recognition model, and the intention recognition model increases the attention level of the target keyword based on the prompt information.
2. The method according to claim 1, in, The step of marking prompt information on the first candidate recognition sample based on the target keyword to obtain a first target recognition sample includes: Using the target keyword and the preset separator as prompt information of the target keyword; Add the prompt information at a specified position of the first candidate recognition sample; The first candidate recognition sample after adding the prompt information is determined as the first target recognition sample.
3. The method according to claim 1, in, The step of determining a first candidate recognition sample from a plurality of original intent recognition samples based on keyword level information of a preset keyword vocabulary includes: Based on the keyword level information, a keyword to be matched is selected from the preset keyword word library; the keyword to be matched is a preset keyword that has not been selected and has the highest level; If the keyword to be matched exists in the original intent recognition sample, the original intent recognition sample is determined to be a first candidate recognition sample; the at least one target keyword of the first candidate recognition sample includes a keyword that matches the keyword to be matched; If the original intent recognition sample does not contain the to-be-matched keyword or does not meet the preset requirements, If the keyword matches the stop condition, the next keyword to be matched will be selected from the preset keyword database.
4. The method according to claim 3, in, The preset keyword word library includes a plurality of preset keywords related to the complaint intention; the keyword level information includes keyword level information to which the preset keywords belong and the strength of the complaint intention of the preset keywords at the level to which they belong; The selecting a keyword to be matched from the preset keyword word library based on the keyword level information includes: Based on the keyword level information, among multiple unselected preset keywords, select the preset keyword with the highest keyword level and the strongest complaint intention; The selected preset keyword is determined as the keyword to be matched.
5. The method according to claim 1, in, Before generating a target sample data set based on the first target recognition sample, the method further includes: Performing data enhancement processing based on the first candidate recognition sample to generate multiple new intent recognition samples; Based on the keyword level information, determining a second candidate recognition sample among the multiple newly added intent recognition samples; the second candidate recognition sample includes at least one target keyword that satisfies the preset keyword level constraint condition; Based on the target keyword, marking prompt information on the second candidate recognition sample to obtain a second target recognition sample; The generating a target sample data set based on the first target recognition sample includes: A target sample data set is generated based on the first target recognition sample and the second target recognition sample.
6. The method according to claim 5, in, The performing data enhancement processing based on the first candidate recognition sample to generate multiple new intent recognition samples includes: Perform masking on the specific keywords in the first candidate recognition sample to obtain the intent to be completed Identify samples; the specific keywords are keywords that meet preset keyword blocking constraints; The to-be-completed intent recognition sample is completed to obtain a newly added intent recognition sample.
7. The method according to claim 6, in, The completing the to-be-completed intent recognition sample to obtain a newly added intent recognition sample includes: Inputting the to-be-completed intention recognition sample into a first pre-training model to predict the to-be-completed words at the vacant positions in the to-be-completed intention recognition sample; Based on the words to be completed, the intent recognition samples to be completed are completed to obtain new intent recognition samples.
8. The method according to claim 5, in, The determining, based on the keyword level information, a second candidate recognition sample from the plurality of newly added intent recognition samples comprises: Based on the keyword level information, an initial candidate recognition sample is selected from the multiple newly added intent recognition samples; the initial candidate recognition sample includes at least one target keyword that meets the preset keyword level constraint condition; Inputting the initial candidate recognition sample and its corresponding first candidate recognition sample into the second pre-training model for semantic recognition to obtain a semantic recognition result; the semantic recognition result includes a target confidence level representing whether the semantics of the initial candidate recognition sample has changed; Based on the target confidence, a second candidate recognition sample having a target confidence greater than a preset threshold among the plurality of initial candidate recognition samples is determined.
9. The method according to claim 5, in, The determining, based on the keyword level information, a second candidate recognition sample from the plurality of newly added intent recognition samples comprises: Using the second pre-trained model to perform semantic recognition on the multiple newly added intent recognition samples to obtain semantic recognition results; the semantic recognition results include target confidences that characterize whether the semantics of the newly added intent recognition samples have changed; Based on the target confidence, determine the target confidence of the multiple newly added intent recognition samples. Initially add new identification samples at the preset threshold; Based on the keyword level information, a second candidate recognition sample is determined from the plurality of initial newly added recognition samples; the second candidate recognition sample includes at least one target keyword that satisfies the constraint condition corresponding to the preset keyword level.
10. The method according to claim 8 or 9, in, Before generating a target sample data set based on the first target recognition sample and the second target recognition sample, the method further includes: Determine a second true label of the second candidate recognition sample based on the target confidence of the second candidate recognition sample and the first true label of the first candidate recognition sample corresponding to the second candidate recognition sample; Determine the true label of the second target recognition sample based on the second true label; and determine the true label of the first target recognition sample based on the first true label; The generating a target sample data set based on the first target recognition sample and the second target recognition sample comprises: A target sample data set is generated based on the first target recognition sample and its true label, and the second target recognition sample and its true label.
11. A method for training an intent recognition model, the method include: Acquire multiple target recognition samples, wherein the target recognition samples include a candidate recognition sample and prompt information of a target keyword in the candidate recognition sample; The target recognition sample is input into the intention recognition model to be trained to iteratively update the model parameters to obtain a trained intention recognition model; the intention recognition model increases the attention level of the target keyword based on the prompt information.
12. The method according to claim 11, in, The step of inputting the target recognition sample into the intention recognition model to be trained to iteratively update the model parameters to obtain the trained intention recognition model includes: Inputting the target recognition sample into the intention recognition model to be trained to obtain an initial weight sequence; the initial weight sequence includes the initial weight of each word in the candidate recognition sample; Based on the prompt information about the target keyword in the target recognition sample, the initial weight sequence is adjusted to obtain a target weight sequence; Determine a text feature vector of the target recognition sample based on the target weight sequence and the word vector of each word in the candidate recognition sample; The model parameters of the intent recognition model to be trained are iteratively updated based on the text feature vectors of each of the target recognition samples to obtain a trained intent recognition model.
13. A method for identifying intentions, the method comprising: include: Determine the target keywords in the original text sentence to be identified based on the keyword level information of the preset keyword word library; The target keyword is a keyword that satisfies the constraint condition corresponding to the keyword level information; Based on the target keyword, the original text sentence is marked with prompt information to obtain a target text sentence; the target text sentence includes the original text sentence and the prompt information of the target keyword; Inputting the target text sentence into the trained intent recognition model for intent recognition to obtain an intent recognition result; The intention recognition model increases the attention level of the target keyword based on the prompt information.
14. The method according to claim 13, in, The step of inputting the target text sentence into the trained intent recognition model for intent recognition to obtain an intent recognition result includes: Inputting the target text sentence into the trained intention recognition model to obtain an initial weight sequence; the initial weight sequence includes the initial weight of each word in the original text sentence; Based on the prompt information about the target keyword in the target text sentence, the initial weight sequence is adjusted to obtain a target weight sequence; Determine a text feature vector of the target text sentence based on the target weight sequence and the word vector of each word in the original text sentence; Intent recognition is performed based on the text feature vector of the target text sentence to obtain an intent recognition result corresponding to the target text sentence.
15. A device for generating an intention recognition sample, the device include: A candidate sample set acquisition module, used to determine a first candidate recognition sample from a plurality of original intent recognition samples based on keyword level information of a preset keyword vocabulary; Each of the first candidate recognition samples includes at least one target keyword that satisfies the constraint condition corresponding to the keyword level information; A keyword prompt marking module, used to mark prompt information on the first candidate recognition sample based on the target keyword to obtain a first target recognition sample; A target sample set generation module is used to generate a target sample data set based on the first target recognition sample; the target sample data set is used to train an intention recognition model, and the intention recognition model increases the attention level of the target keyword based on the prompt information.
16. An intention recognition device, the device include: A keyword determination module, used to determine target keywords in the original text sentence to be identified based on keyword level information of a preset keyword vocabulary; The target keyword is a keyword that satisfies the constraint condition corresponding to the keyword level information; A keyword prompt marking module is used to mark prompt information on the original text sentence based on the target keyword to obtain a target text sentence; An intention recognition module is used to input the target text sentence into the trained intention recognition model to perform intention recognition and obtain an intention recognition result; The intention recognition model increases the attention level of the target keyword based on the prompt information.
17. A computer device, the device include: processor; as well as A memory arranged to store computer executable instructions, the executable instructions being configured to be executed by the processor, the executable instructions comprising instructions for performing the steps of the method as claimed in any one of claims 1 to 10, any one of claims 11 to 12 or any one of claims 13 to 14.
18. A storage medium for storing computer-executable instructions, wherein the executable instructions enable a computer to execute the method according to any one of claims 1 to 10, any one of claims 11 to 12, or any one of claims 13 to 14.
19. A computer program product, comprising a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to perform the method of any one of claims 1 to 10, any one of claims 11 to 12, or any one of claims 13 to 14.
Citation Information
Patent Citations
Text data processing method, device and equipment and storage medium
CN111444326A
Intention recognition method and device and computer readable storage medium
CN111563208A
Training corpus expansion method and device and intention recognition model training method and device
CN112651238A
Intention recognition method and device, equipment and medium
CN113360751A
Text recognition model training method and device
CN114581918A
Cited By
Intelligent report insight system for bank industry marketing process data analysis
CN120912307A
Target identification method and device, equipment, storage medium and product
CN120997785A
