The invention discloses a few-sample intention recognition method, which comprises the following steps of: replacing a data fragment by using field-independent data according to a probability random mask to obtain pre-training data and a pre-training language model; constructing a corresponding prompt template for each intention category; constructing training data of a multi-intention recognition model according to the prompt template; and secondarily training the pre-training model by using the intention recognition training data on the basis of the pre-training language model. Under the conditions of no limitation and manual construction of a large amount of rules and lack of domain data, the performance obtained by a small amount of domain intention recognition training data is close to the model performance obtained by a large amount of domain intention recognition training data. The problems that in methods based on data enhancement, meta-learning, pre-training fine tuning and the like, a large amount of manpower is needed to formulate data enhancement rules, a large amount of similar task data is relied on, and a certain amount of fine tuning data is needed are solved.
Few-sample intention recognition method and device