Intention recognition method, device, apparatus, storage medium and computer program product

By classifying search terms using intent category and intent subcategory recognition models, the problem of low efficiency in recognizing all search terms is solved, achieving efficient intent recognition and resource optimization.

CN115129863BActive Publication Date: 2026-02-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210380464.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-12
Publication Date
2026-02-24
Estimated Expiration
2042-04-12

AI Technical Summary

Technical Problem

Existing technologies cannot fully identify the intent of all search terms, resulting in low identification efficiency.

Method used

By using the trained intent category recognition model and intent subcategory recognition model, the intent category and intent subcategory are recognized for each word in the word set. First, the intent category is recognized, and then the intent subcategory is further recognized by the intent subcategory recognition model of the target intent category.

Benefits of technology

It achieves comprehensive intent recognition for term sets from different fields, improving recognition efficiency and saving manual annotation costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115129863B_ABST
    Figure CN115129863B_ABST
Patent Text Reader

Abstract

The application relates to an intent recognition method and device, computer equipment, a storage medium and a computer program product. The method relates to natural language processing of artificial intelligence technology, and comprises the following steps: acquiring a word set to be subjected to intent recognition; performing intent macro-class recognition on each word in the word set by using a trained intent macro-class recognition model, so that the intent macro-class to which each word in the word set belongs is obtained; for the words belonging to a target intent macro-class in the word set, performing intent sub-class recognition on the words belonging to the target intent macro-class by using a trained intent sub-class recognition model corresponding to the target intent macro-class, so that the intent sub-class to which the words belonging to the target intent macro-class belong is obtained, and each intent sub-class belongs to the target intent macro-class. According to the method, the corresponding intent macro-class and intent sub-class can be comprehensively recognized for a word set composed of words in different fields, and the intent recognition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an intent recognition method, apparatus, computer device, storage medium, and computer program product, as well as an intent recognition model processing method, apparatus, computer device, storage medium, and computer program product. Background Technology

[0002] In recent years, artificial intelligence technology has developed rapidly, driving technological progress and social development, and bringing tremendous changes to people's lives. Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies various theories and methods that enable effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics.

[0003] Intention recognition is a branch of natural language processing that parses text into structured, machine-readable intents. It is widely used in scenarios such as identity recognition, speech recognition, language translation, and sentiment analysis. For example, in search scenarios, it identifies the intent behind search terms.

[0004] However, current intent recognition for search terms is limited to terms in a specific domain, and cannot comprehensively and directly recognize the intent of all search terms, resulting in low recognition efficiency. Summary of the Invention

[0005] Therefore, it is necessary to provide an intent recognition method, apparatus, computer device, computer-readable storage medium, and computer program product that can perform intent recognition on a full range of search terms, addressing the aforementioned technical problems.

[0006] This application provides an intent recognition method. The method includes:

[0007] Obtain the set of terms to be identified for intent recognition;

[0008] By using the trained intent category recognition model, intent category recognition is performed on each word in the word set to obtain the intent category to which each word in the word set belongs.

[0009] For the words in the word set that belong to the target intent category, the intent subclass recognition model corresponding to the target intent category is trained to identify the intent subclass of the words belonging to the target intent category, thereby obtaining the intent subclass to which the words belonging to the target intent category belong, and each intent subclass belongs to the target intent category.

[0010] This application also provides an intent recognition device. The device includes:

[0011] The acquisition module is used to acquire a set of terms to be identified for intent recognition;

[0012] The intent category recognition module is used to perform intent category recognition on each word in the word set using a trained intent category recognition model, so as to obtain the intent category to which each word in the word set belongs.

[0013] The intent subclass recognition module is used to identify the intent subclass of the words belonging to the target intent category in the word set by using a trained intent subclass recognition model corresponding to the target intent category, and to obtain the intent subclass to which the words belonging to the target intent category belong, with each intent subclass belonging to the target intent category.

[0014] In one embodiment, the intent category recognition module is further configured to input the term into the trained intent category recognition model, output the vectorized representation of the term, calculate the distance between the vectorized representation of the term and the intent prototype representation of each intent category, normalize each distance, and take the intent category corresponding to the intent prototype representation with the smallest normalized distance as the intent category to which the term belongs.

[0015] In one embodiment, the apparatus further includes an intent prototype representation determination module, configured to acquire sample words labeled with intent categories used when training the intent category recognition model, divide sample words belonging to the same intent category into a support set and a query set, input the corresponding sample words from the support set into the trained intent category recognition model for each intent category, obtain the vectorized representation of each sample word in the support set, calculate the mean of the vectorized representation of each sample word in the support set, and obtain the intent prototype representation of each intent category.

[0016] In one embodiment, the intent subclass recognition module is further configured to acquire a trained intent subclass recognition model corresponding to the target intent category, query a character vector table, convert each character in the term into a character vector, obtain a classification vector representation of the term based on the character vector through the semantic representation network in the intent subclass recognition model, the classification vector representation being used to characterize the global semantic information of the term, obtain the predicted probability of the term belonging to each intent subclass under the target intent category through the classification prediction network in the intent subclass recognition model based on the classification vector representation, and determine the intent subclass to which the term belongs based on the predicted probability.

[0017] In one embodiment, the apparatus further includes:

[0018] The first training module is used to acquire sample terms belonging to labeled intent categories; to divide sample terms belonging to the same intent category into a support set and a query set; for each intent category, the sample terms from the corresponding support set and query set are input into the intent category recognition model to obtain the vectorized representation of each sample term; based on the vectorized representation of each sample term in the support set, the intent prototype representation of each intent category is determined; with the objective of minimizing the difference between the vectorized representation of the sample terms in the corresponding query set and the intent prototype representation of the labeled intent category, and maximizing the difference between the vectorized representation of the sample terms and the intent prototype representation of intent categories other than the labeled intent category, an intent category recognition loss is constructed; and the intent category recognition model is optimized based on the intent category recognition loss.

[0019] In one embodiment, the first training module is further configured to, for each intent category, calculate the distance between the vectorized representation of the sample word in the corresponding query set and the intent prototype representation of each intent category, and take the intent category corresponding to the intent prototype representation with the smallest distance as the predicted intent category corresponding to the sample word; calculate the cross-entropy based on the predicted intent category and the labeled intent subclass of the sample word to obtain the cross-entropy loss of each intent category; and sum the cross-entropy losses of each intent category to obtain the intent category recognition loss.

[0020] In one embodiment, the apparatus further includes:

[0021] The second training module is used to acquire sample words belonging to the target intent category and whose intent subcategories have been labeled; through a pre-trained semantic representation network, it outputs the classification vector representation of the sample words, inputs the classification vector representation into a classification prediction network, and through the classification prediction network, obtains the predicted probability of the sample words belonging to each intent subcategory under the target intent category based on the classification vector representation; determines the predicted intent subcategory corresponding to the sample words based on the predicted probability; and trains the semantic representation network and the classification prediction network together based on the difference between the determined predicted intent subcategory and the labeled intent subcategory of the sample words to obtain the intent subcategory recognition model under the target intent category.

[0022] In one embodiment, the second training module is further configured to query a character vector table, convert each character in the sample term into a character vector; input the character vector corresponding to each character and the character vector corresponding to the classification symbol into the pre-trained semantic representation network, and output the semantic vector representation of each character and the classification vector representation corresponding to the classification symbol, wherein the classification vector representation is used to characterize the global semantic information of the sample term.

[0023] In one embodiment, the second training module is further configured to input the classification vector representation into the classification prediction network; and sequentially pass through the fully connected layer and activation layer of the classification prediction network to obtain the predicted probability that the sample word belongs to each intention subclass under the target intention category.

[0024] In one embodiment, the second training module is further configured to calculate cross-entropy based on the determined predicted intent subclass and the labeled intent subclass of the sample words to obtain intent subclass recognition loss; with the goal of minimizing the intent subclass recognition loss, after updating the network parameters of the pre-trained semantic representation network and the classification prediction network, return to the step of obtaining sample words belonging to the target intent category and labeled intent subclass to continue training until the training stopping condition is met.

[0025] In one embodiment, the second training module further includes a pre-training submodule, configured to: acquire coarse-labeled sample words of coarse-labeled intention subclasses; randomly mask the characters in the coarse-labeled sample words; input the randomly masked coarse-labeled sample words into a language model; output the classification vector representation of the coarse-labeled sample words and the semantic vector representation of the masking position; input the classification vector representation into a classification prediction network to obtain the predicted probability that the coarse-labeled sample words belong to each intention subclass; determine the predicted intention subclass corresponding to the coarse-labeled sample words based on each predicted probability; determine the predicted character at the masking position based on the semantic vector representation of the masking position; construct a pre-training loss based on the difference between the labeled intention subclass of the coarse-labeled sample words and the predicted intention subclass, as well as the difference between the masked character and the predicted character; and train the language model based on the pre-training loss to obtain a pre-trained semantic representation network.

[0026] In one embodiment, the acquisition module is further configured to acquire all search terms of the resource search platform within a predetermined period; the device further includes: a resource publishing module, configured to, after obtaining the intent category and intent subcategory to which each term belongs in the all-search terms, determine the quantity distribution of terms in each intent subcategory under each intent category; and publish resources belonging to the corresponding intent category in the resource search platform according to the quantity distribution.

[0027] This application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0028] Obtain the set of terms to be identified for intent recognition;

[0029] By using the trained intent category recognition model, intent category recognition is performed on each word in the word set to obtain the intent category to which each word in the word set belongs.

[0030] For the words in the word set that belong to the target intent category, the intent subclass recognition model corresponding to the target intent category is trained to identify the intent subclass of the words belonging to the target intent category, thereby obtaining the intent subclass to which the words belonging to the target intent category belong, and each intent subclass belongs to the target intent category.

[0031] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0032] Obtain the set of terms to be identified for intent recognition;

[0033] By using the trained intent category recognition model, intent category recognition is performed on each word in the word set to obtain the intent category to which each word in the word set belongs.

[0034] For the words in the word set that belong to the target intent category, the intent subclass recognition model corresponding to the target intent category is trained to identify the intent subclass of the words belonging to the target intent category, thereby obtaining the intent subclass to which the words belonging to the target intent category belong, and each intent subclass belongs to the target intent category.

[0035] This application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0036] Obtain the set of terms to be identified for intent recognition;

[0037] By using the trained intent category recognition model, intent category recognition is performed on each word in the word set to obtain the intent category to which each word in the word set belongs.

[0038] For the words in the word set that belong to the target intent category, the intent subclass recognition model corresponding to the target intent category is trained to identify the intent subclass of the words belonging to the target intent category, thereby obtaining the intent subclass to which the words belonging to the target intent category belong, and each intent subclass belongs to the target intent category.

[0039] The aforementioned intent recognition method, apparatus, computer device, storage medium, and computer program product, after acquiring the set of terms to be recognized, first identify the intent category to which each term belongs using a trained intent category recognition model. For terms belonging to the same target intent category, the corresponding intent subcategory recognition model under that target intent category is further used to identify the intent subcategory to which the term belongs. Thus, compared to related technologies that can only identify the intent subcategory to which terms belong in a specific domain, this application can comprehensively identify the corresponding intent categories and intent subcategories for a set of terms composed of terms from different domains, improving intent recognition efficiency.

[0040] This application also provides a method for processing an intent recognition model, the method comprising:

[0041] By using a trained intent category recognition model, the intent category of each sample word is identified, thus obtaining the intent category to which each sample word belongs.

[0042] Obtain sample terms that belong to the target intent category and have been labeled with intent subcategories;

[0043] The sample words are input into a pre-trained semantic representation network to obtain a classification vector representation of the sample words. The classification vector representation is then input into a classification prediction network to obtain the prediction probability that the sample words belong to each intention subclass under the target intention category. Based on each prediction probability, the predicted intention subclass corresponding to the sample words is determined.

[0044] Based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample word, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain the intent subclass recognition model under the target intent category.

[0045] This application also provides a processing apparatus for an intent recognition model, the apparatus comprising:

[0046] The acquisition module is used to identify the intent category of sample words by using a trained intent category recognition model, obtain the intent category to which each sample word belongs, and acquire sample words that belong to the target intent category and have been labeled with intent subclasses.

[0047] The prediction module is used to input the sample word into a pre-trained semantic representation network to obtain the classification vector representation of the sample word, input the classification vector representation into a classification prediction network to obtain the prediction probability that the sample word belongs to each intention subclass under the target intention category, and determine the predicted intention subclass corresponding to the sample word based on each prediction probability.

[0048] The update module is used to train the pre-trained semantic representation network and the classification prediction network together based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample word, so as to obtain the intent subclass recognition model under the target intent category.

[0049] This application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0050] By using a trained intent category recognition model, the intent category of each sample word is identified, thus obtaining the intent category to which each sample word belongs.

[0051] Obtain sample terms that belong to the target intent category and have been labeled with intent subcategories;

[0052] The sample words are input into a pre-trained semantic representation network to obtain a classification vector representation of the sample words. The classification vector representation is then input into a classification prediction network to obtain the prediction probability that the sample words belong to each intention subclass under the target intention category. Based on each prediction probability, the predicted intention subclass corresponding to the sample words is determined.

[0053] Based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample word, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain the intent subclass recognition model under the target intent category.

[0054] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0055] By using a trained intent category recognition model, the intent category of each sample word is identified, thus obtaining the intent category to which each sample word belongs.

[0056] Obtain sample terms that belong to the target intent category and have been labeled with intent subcategories;

[0057] The sample words are input into a pre-trained semantic representation network to obtain a classification vector representation of the sample words. The classification vector representation is then input into a classification prediction network to obtain the prediction probability that the sample words belong to each intention subclass under the target intention category. Based on each prediction probability, the predicted intention subclass corresponding to the sample words is determined.

[0058] Based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample word, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain the intent subclass recognition model under the target intent category.

[0059] This application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0060] By using a trained intent category recognition model, the intent category of each sample word is identified, thus obtaining the intent category to which each sample word belongs.

[0061] Obtain sample terms that belong to the target intent category and have been labeled with intent subcategories;

[0062] The sample words are input into a pre-trained semantic representation network to obtain a classification vector representation of the sample words. The classification vector representation is then input into a classification prediction network to obtain the prediction probability that the sample words belong to each intention subclass under the target intention category. Based on each prediction probability, the predicted intention subclass corresponding to the sample words is determined.

[0063] Based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample word, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain the intent subclass recognition model under the target intent category.

[0064] The above-mentioned intention recognition model processing method, when training the intention subclass recognition model, first uses the trained intention major class recognition model to perform intention major class recognition on the sample words to obtain the intention major class to which each sample word belongs. Since the intention major class of the training samples has been identified, the training of the intention subclass recognition model under the target intention major class only requires a small number of sample words that all belong to the target intention major class and have been labeled with intention subclasses. Specifically, these sample words are input into the pre-trained semantic representation network to obtain the classification vector representation of the sample words. Then, the classification vector representation is input into the classification prediction network to obtain the predicted probability that the sample words belong to each intention subclass under the target intention major class. Based on each predicted probability, the predicted intention subclass corresponding to the sample words is determined. Finally, based on the difference between the determined predicted intention subclass and the labeled intention subclass of the sample words, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain the intention subclass recognition model under the target intention major class. Since all the sample words input into the network belong to the target intent category, only a small number of samples are needed for fine-tuning the network to obtain an intent subclass recognition model under the target intent category, saving manual annotation costs. Furthermore, the trained intent subclass recognition model under the target intent category, combined with the trained intent category recognition model, can be used to comprehensively identify the corresponding intent category and intent subclass for word sets composed of words from various domains, improving intent recognition efficiency. Attached Figure Description

[0065] Figure 1 This is a diagram illustrating the application environment of the intent recognition method in one embodiment;

[0066] Figure 2A A flowchart illustrating the process of identifying the specific intent of text in the automotive field using related technologies;

[0067] Figure 2B This is a schematic diagram of the overall process of an intent recognition method in one embodiment;

[0068] Figure 3 This is a flowchart illustrating an intent recognition method in one embodiment;

[0069] Figure 4 This is a schematic diagram of the "Search" interface in the target client in one embodiment;

[0070] Figure 5 This is a schematic diagram of the process for identifying major intent categories in one embodiment;

[0071] Figure 6 This is a schematic diagram illustrating the intent category to which each term belongs in one embodiment;

[0072] Figure 7This is a schematic diagram of the structure of an intent subclass recognition model in one embodiment;

[0073] Figure 8 This is a flowchart illustrating the process of training an intent category recognition model in one embodiment;

[0074] Figure 9 This is a schematic diagram of the model structure for pre-training an intent subclass recognition model in one embodiment;

[0075] Figure 10 This is a flowchart illustrating the process of fine-tuning the training intent subclass recognition model in one embodiment;

[0076] Figure 11 This is a schematic diagram of the network structure of a classification prediction network in one embodiment;

[0077] Figure 12 This is a schematic diagram of the model structure for fine-tuning the training intent subclass recognition model in one embodiment;

[0078] Figure 13 A schematic diagram of a model structure for multi-task training of a semantic representation network for multiple intent categories in one embodiment;

[0079] Figure 14 This is a schematic diagram of the interface of an intent-to-identify platform tool in one embodiment;

[0080] Figure 15 This is a schematic diagram of the processing flow of an intent recognition platform in one embodiment;

[0081] Figure 16 This is a schematic diagram illustrating the distribution of statistics for the query set to be classified in one embodiment;

[0082] Figure 17 This is a structural block diagram of an intent recognition device in one embodiment;

[0083] Figure 18 This is a structural block diagram of a processing device for an intent recognition model in one embodiment;

[0084] Figure 19 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0085] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0086] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0087] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0088] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0089] The intent recognition method and intent recognition model processing method provided in the embodiments of this application can both be applied to, for example, Figure 1 The application environment shown is illustrated. Terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another server.

[0090] In one embodiment, a target client may be installed and run on terminal 102, and server 104 may be a server providing search services to the target client. Users can search for desired content by entering search terms (Query) in the target client. The target client may be an instant messaging client, video client, e-commerce client, etc. Server 104 can collect a massive number of search terms entered in the target client as a term set to be identified for intent recognition. Then, server 104 or terminal 102 uses a trained intent category recognition model to identify the intent category of each term in the term set, thereby obtaining the intent category to which each term belongs. The intent category can be understood as the domain involved by the term, such as automobiles, education, shopping, finance, etc. For terms in the term set that belong to the target intent category, the server 104 or terminal 102 further uses the trained intent subclass recognition model corresponding to the target intent category to identify the intent subclass of the terms belonging to the target intent category, and obtain the intent subclass to which the terms belonging to the target intent category belong. Each intent subclass belongs to the target intent category. For example, if the target intent category is automobile, the corresponding intent subclasses may include inquiry terms, brand terms, model terms, general terms, etc.

[0091] Furthermore, server 104 or terminal 102 can perform data analysis based on the distribution of the number of terms belonging to various intent categories and subcategories, guiding the introduction of various types of content in search scenarios. For example, if a large number of search terms show that a certain model of a certain brand of car has a high search frequency, the computer equipment can allocate more promotion slots to display information about that model, or increase the publication volume of information about other models of the brand, avoiding the use of hardware and network resources needed for information placement on content with low search volume, thus improving the utilization rate of hardware and network resources.

[0092] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0093] In related technologies, intent recognition typically only identifies the specific intent of text within a particular domain. Taking the automotive domain as an example, specific intents include general terms, vehicle model terms, price inquiry terms, brand terms, dealership terms, owner services, Q&A, motorcycles, etc. Identifying specific intents for automotive text involves two stages: First, during model training, a large amount of precisely labeled data needs to be manually annotated to identify the corresponding specific intents within the automotive domain. Then, a multi-classification model for the finer categories of the automotive domain is trained based on this data. Second, during model testing or application, the trained multi-classification model directly determines the specific intent of the text. For example... Figure 2A As shown, in related technologies, taking the automotive field as an example, training a multi-classification model requires a large amount of manually labeled data. The labeled data should label the subdivided intents corresponding to the automotive field terms, which makes the labeling cost very high. Moreover, it is limited to subdivided intent recognition for automotive field terms. If the terms are not automotive field terms, only negative examples can be identified. It is impossible to comprehensively and directly perform intent recognition on the full range of search terms involving many fields. The intent recognition effect is limited and the efficiency is low.

[0094] The intent recognition method provided in the embodiments of this application, such as Figure 2B As shown, for a set of terms from different domains, the intent category is first identified using an intent category recognition model. For terms belonging to the target intent category, the corresponding intent subcategories are further identified using a corresponding intent subcategories recognition model. This allows for direct and comprehensive identification of both the intent category and its subcategories, improving intent recognition performance. Furthermore, during training, the trained intent category recognition model identifies the intent category of the sample terms, ensuring that all sample terms input into the intent subcategories recognition model belong to the target intent category. This means that only a small number of samples are needed for fine-tuning the network training of the intent subcategories recognition model, resulting in an intent subcategories recognition model under the target intent category. This significantly reduces the manual annotation costs required for training the intent subcategories recognition model.

[0095] In one embodiment, such as Figure 3 As shown, an intent recognition method is provided, which is applied to... Figure 1 The following steps are described using a computer device (e.g., terminal 102 or server 104) as an example:

[0096] Step 302: Obtain the set of words to be identified for intent recognition.

[0097] The term set is a collection of terms from various different fields. These terms cover multiple fields, each representing a different major intent category, and search terms within the same field can correspond to different subcategories of intent. For example, the fields to which terms belong may include automobiles, education, shopping, finance, etc. Terms in the automobile field can be further divided into general terms, model terms, price inquiry terms, brand terms, dealerships, owner services, Q&A, motorcycles, etc. Terms in the education field can be further divided into early childhood education, English, training, physical exercise, swimming, calligraphy, etc. By performing intent recognition on each term in the term set, computer devices can obtain the corresponding major intent category and subcategory. Furthermore, the computer devices can perform data analysis based on the distribution of the number of terms belonging to each major intent category and subcategory, guiding the introduction of various resources in the search scenario. This allows the hardware and network resources needed for resource deployment to be used on the objects searched by the majority of the search audience, effectively utilizing the necessary hardware and network resources.

[0098] In one embodiment, a target client can be installed and run on the terminal. For search terms entered by different users through the target client, the terminal can initiate a search request to the server based on the entered search terms. The server responds to the search request by providing corresponding resources or services. The server can also record these search terms, forming a term set for intent recognition. For example, the server can count the search terms entered through the target client within a day, a week, or a month to form a term set. The search services provided by the target client can include information search, product search, video search, image and text search, etc. Figure 4 The image shown is a schematic diagram of the "Search" interface in the target client in one embodiment. (Refer to...) Figure 4 Users can enter search terms in the search box on this interface to search. The search scope can include "Moments", "Mini Programs", "Official Accounts", "Articles", "Music", "Emojis", etc.

[0099] Step 304: Using the trained intent category recognition model, perform intent category recognition on each word in the word set to obtain the intent category to which each word in the word set belongs.

[0100] In this application, the trained intent category recognition model is a machine learning model that has been trained beforehand using training samples and is capable of automatically identifying the intent category to which a search term belongs. The training process of the intent category recognition model will be described in detail later. In this application, for each search term in the term set, the computer device can input it into the trained intent category recognition model, which then outputs the intent category to which each term belongs.

[0101] In one embodiment, step 304 includes: inputting the word into the trained intent category recognition model and outputting the vectorized representation of the word; calculating the distance between the vectorized representation of the word and the intent prototype representation of each intent category; normalizing each distance; and taking the intent category corresponding to the intent prototype representation with the smallest normalized distance as the intent category to which the word belongs.

[0102] In this application, the intent category recognition model can employ a prototype network for learning with a small number of samples. For example... Figure 5 The diagram shown illustrates the process of intent category recognition using a trained intent category recognition model in one embodiment. (Refer to...) Figure 5 The intent category model includes a deep semantic representation unit and a computation unit. The computer device can input the term into the deep semantic representation unit to obtain the vectorized representation of the term. Then, the computation unit calculates the distance between the vectorized representation of the term and the prototype representation of each intent category. After normalizing each distance, the intent category corresponding to the prototype representation of the intent with the smallest normalized distance is taken as the intent category to which the term belongs.

[0103] When a computer device inputs a word into a deep semantic representation unit (DSUnit), it first queries a word vector table to obtain the word vectors corresponding to each character in the word, forming a word vector sequence. This word vector sequence is then used as input to an intent category recognition model and fed into the DUnit. Through the computation of multiple layers of neural networks within the DUnit, a vectorized representation of the word is output. The DUnit can employ BERT (an autoencoder language model) for the vectorized representation of short texts.

[0104] Next, the computer device uses its processing unit to calculate the distance between the vectorized representation and the prototype representation of each intent category. This distance can be Euclidean distance. Then, it is normalized using a normalization function, and the prototype representation with the shortest distance is selected as the intent category corresponding to that term. The normalization function can be, for example, the softmax function. Figure 6 As shown, the distance between the vectorized representation X and the prototype representation of each intent category is calculated: education, shopping, automobile, finance, and others. Their respective prototype representations are C1, C2, C3, C4, and C5. The distance representation X is closest to the prototype representation of automobile C3. Therefore, the term represented by X is determined to belong to the automobile intent category.

[0105] In this way, by using the trained intent category recognition model, the intent category to which each word belongs is output, and the domain to which each word in the word set belongs is determined, which facilitates the subsequent use of the intent subclass recognition model of that domain to recognize intent subclasses.

[0106] In one embodiment, the prototype representation of each intent category can be determined in the following way:

[0107] The sample words of the labeled intent categories used when training the intent category recognition model are obtained; among them, the sample words belonging to the same intent category are divided into a support set and a query set; for each intent category, the sample words in the corresponding support set are input into the trained intent category recognition model to obtain the vectorized representation of each sample word in the support set, and the mean of the vectorized representation of each sample word in the support set is calculated to obtain the intent prototype representation of each intent category.

[0108] Specifically, the intent category model is trained using a small number of samples, employing an "N-way; K-shot" approach. This means that N intent categories participate in training each time, and each intent category is divided into a support set and a query set. The number of sample terms in the support set is K. After training the intent category recognition model, vectorized representations of the sample terms belonging to the support set of each intent category can be obtained from the training set. (Refer to...) Figure 6 The irregular squares belong to the same intention category. The outer small circles inside the irregular squares represent the vectorized representations of each sample word in the support set of a certain intention category. The middle small circle represents the mean obtained by calculating the vectorized representations of each sample word in the support set, which represents the prototype representation of the intention of that intention category.

[0109] Step 306: For words in the word set that belong to the target intent category, use the trained intent subclass recognition model corresponding to the target intent category to perform intent subclass recognition on the words that belong to the target intent category, and obtain the intent subclass to which the words belonging to the target intent category belong. Each intent subclass belongs to the target intent category.

[0110] In this application, each major intent category can be further subdivided into different intent subcategories, thus each major intent category corresponds to a different intent subcategory recognition model. It is understood that the model structure of the intent subcategory recognition models corresponding to different major intent categories can be the same, with only differences in model parameters. The computer device can obtain the pre-trained model parameters of the intent subcategory recognition models corresponding to each major intent category, import them into the pre-constructed initial intent subcategory recognition model, obtain the intent subcategory recognition models corresponding to different major intent categories, and then use these intent subcategory recognition models to identify the intent subcategory to which the sample words belong in parallel.

[0111] The trained intent subclass recognition model corresponding to the target intent category is a machine learning model that has been trained beforehand using training samples from the target intent category. It possesses the ability to automatically identify the intent subclass to which a search term belongs. The training process of the intent subclass recognition model will be described in detail later. The target intent category can be any one of the predefined intent categories. After identifying the intent category to which each sample term belongs, the computer device can use the intent subclass recognition model corresponding to that intent category to further identify the intent subclass of the term and obtain its intent subclass.

[0112] In one embodiment, step 306 includes: obtaining a trained intent subclass recognition model corresponding to the target intent category; querying a character vector table, converting each character in the word into a character vector, and then obtaining a classification vector representation of the word based on the character vector through the semantic representation network in the intent subclass recognition model, wherein the classification vector representation is used to characterize the global semantic information of the word; obtaining the predicted probability of the word belonging to each intent subclass under the target intent category based on the classification vector representation through the classification prediction network in the intent subclass recognition model; and determining the intent subclass to which the word belongs based on the predicted probability.

[0113] like Figure 7 The image shown is a schematic diagram of the structure of an intent subclass recognition model in one embodiment. (Refer to...) Figure 7 The target intent category and its corresponding intent subcategory recognition model include a semantic representation network and a classification prediction network. The semantic representation network can use BERT for vectorized representation of short texts. The input to the semantic representation network includes the words to be identified belonging to the target intent category. The word vectors E1, E2, E3… corresponding to each character Tok1, Tok2, Tok3… in the word are input to the semantic representation network. In addition, to obtain the global semantic information of the words to be identified, the input to the semantic representation network also includes the word vector E[CLS] corresponding to the classification symbol [CLS] and the word vector E[SEP] corresponding to the separator [SEP]. After processing by multiple layers of neural networks within the semantic representation network, the output is the semantic vector representation T1, T2, T3… corresponding to each character and the classification vector representation T[CLS] representing the global semantic information of the input words. The semantic representation network can use BERT for vectorized representation of short texts. Then, through the classification prediction network, the predicted probability of the input word belonging to each intention subclass under the target intention category is obtained according to the classification vector representation T[CLS]. The intention subclass corresponding to the highest predicted probability is taken as the intention subclass to which the word belongs.

[0114] The aforementioned intent recognition method, after obtaining the set of terms to be identified, first uses a trained intent category recognition model to identify the intent category to which each term belongs for each term in the set. For terms belonging to the same target intent category, it further uses the corresponding intent subcategory recognition model under that target intent category to identify the intent subcategory to which the term belongs. Thus, compared to related technologies that can only identify the intent subcategory to which terms belong in a certain domain, this application can comprehensively identify the corresponding intent categories and intent subcategories for a set of terms composed of terms from different domains, thereby improving the intent recognition effect.

[0115] The training process of the intent category recognition model is described below.

[0116] like Figure 8 As shown, in one embodiment, the training steps of the intent category recognition model include:

[0117] 802, retrieve sample terms that have been labeled with the intent category;

[0118] 804, which divides sample terms belonging to the same intent category into a support set and a query set;

[0119] 806. For each intent category, the sample terms from the corresponding support set and query set are input into the intent category recognition model to obtain the vectorized representation of each sample term. Based on the vectorized representation of each sample term in the support set, the intent prototype representation of each intent category is determined.

[0120] 808. The intention class recognition loss is constructed with the objectives of minimizing the difference between the vectorized representation of the sample words in the corresponding query set and the intention prototype representation of the labeled intention class of the sample words, and maximizing the difference between the vectorized representation of the sample words and the intention prototype representation of the intention classes other than the labeled intention classes.

[0121] 810. Optimize the intent category recognition model based on the intent category recognition loss.

[0122] In this embodiment, the intent category recognition model employs a prototype network suitable for Few-shot learning. A small amount of precisely labeled sample data for different intent categories is required, for example, intent categories such as automobile, education, shopping, and finance. The model uses an "N-way; K-shot" approach, meaning that N randomly sampled intent categories participate in training each time. Each intent category is divided into a support set and a query set. The support set includes randomly sampled words, with the number of words potentially being K. The query set includes randomly sampled words, with the number of words potentially being 1. Specific values ​​could be, for example, N = 5, K = 6.

[0123] During each training iteration, sample terms from the support sets and query sets of the N intent categories participating in the training are input into the intent category recognition model to obtain the vectorized representation of each sample term. Based on the vectorized representation of each sample term in the support set, the intent prototype representation of each intent category in the current training state is determined. The goal of model optimization is to ensure that the vectorized representation of the sample term in the query set that satisfies the intent is closest to the intent prototype representation of the intent, while being furthest from other intent prototype representations.

[0124] After optimizing the intent category recognition model, the prototype representation of each intent category can be determined based on the vectorized representations of sample terms in the support set of the training samples for each intent category. During the model testing phase, testing is conducted using unlabeled sample terms, and the testing process is the same as described above. Figure 5 The described recognition process is consistent. Specifically, the test sample is input into the optimized intent category recognition model to obtain the vectorized representation of the test sample. The distance from the vectorized representation of the test sample to the prototype representation of each intent category is calculated. Then, the distances are normalized, and the intent category corresponding to the prototype representation of the intent with the smallest normalized distance is taken as the intent category to which the test sample belongs. Based on the recognition results of a large number of test samples, the optimization effect of the intent category recognition model is evaluated. When the optimization effect meets the preset training termination condition, the trained intent category recognition model is obtained.

[0125] In one embodiment, step 808 includes: for each intent category, calculating the distance between the vectorized representation of the sample word in the corresponding query set and the intent prototype representation of each intent category, and taking the intent category corresponding to the intent prototype representation with the smallest distance as the predicted intent category corresponding to the sample word; calculating the cross-entropy based on the predicted intent category and the labeled intent subclass of the sample word to obtain the cross-entropy loss of each intent category; and summing the cross-entropy losses of each intent category to obtain the intent category recognition loss.

[0126] In this embodiment, the loss function of the intent category recognition model during the training process can be cross-entropy loss. For example, during each training iteration, six sample words are randomly sampled from the support sets of N randomly selected intent categories. These samples are then input into the intent category recognition model to obtain the vectorized representations of each sample word. The mean of the vectorized representations of the six sample words is calculated for each of the N intent categories, resulting in the intent prototype representation Ci (where i ranges from 1 to N) for each of the N intent categories. One sample word is then sampled from the query sets of each of the N intent categories and input into the intent category recognition model to obtain its vectorized representation bi (where i ranges from 1 to N). The distance between this vectorized representation bi and each intent prototype representation Ci is calculated and normalized to obtain the intent prototype representation closest to bi. The intent category corresponding to this closest intent prototype representation is used as the predicted intent category for the sample word. Based on the difference between this predicted intent category and the labeled intent category, the cross-entropy loss for each intent category is obtained. The cross-entropy losses for all categories are summed to obtain the intent category recognition loss. The intent category recognition model is optimized by minimizing this intention category recognition loss. Thus, the training of the intent class model was achieved through few-shot learning.

[0127] The training process of the intent subclass recognition model is described below.

[0128] In this embodiment, the intent subclass recognition model includes a semantic representation network and a classification prediction network. The semantic representation network is a representation network based on a language model. Intent subclass recognition is essentially a multi-classification task. The training process is divided into two stages: a pre-training stage and a fine-tuning training stage.

[0129] Typically, the training process for multi-class classification tasks involves pre-training a language model-based semantic representation network using a large-scale unsupervised text corpus during the pre-training phase, followed by fine-tuning using a small-scale manually annotated supervised corpus, ultimately completing the downstream multi-class classification task. For example, in the pre-training phase, a corpus from Chinese Wikipedia is used, and the semantic representation network (implemented based on a language model) is pre-trained according to the MLM and NSP tasks. The pre-training loss is the sum of Loss_MLM and Loss_NSP, calculated using cross-entropy. The MLM and NSP tasks are primarily for learning the language model. The MLM task is short for Masked Language Model, which randomly masks tokens in the input sequence, takes the vector corresponding to the masked position from the semantic representation network's output, predicts the difference between the predicted vector and the masked token vector, and calculates the difference loss between the predicted vector and the masked token vector to make the predicted result as close as possible to the masked token. NSP stands for Next Sentence Prediction, which involves inputting two sentences into a model and then predicting whether the second sentence is the next sentence after the first sentence.

[0130] In this application, to maintain consistency between the pre-training and fine-tuning phases, a downstream multi-class classification task, namely the CLF task, is introduced during the pre-training phase. Since the CLF task requires labeled data, coarse-labeled sample data from the search scenario is used for training during pre-training. This better adapts to the downstream multi-class classification task during the fine-tuning phase. In other words, the processing tasks in the pre-training phase include both the MLM and CLF tasks, with the loss being the sum of Loss_MLM and Loss_CLF calculated using cross-entropy. The coarse-labeled sample data consists of sample data with less precise labeling of intent subclasses. Since the pre-training phase primarily focuses on pre-training the semantic representation network based on the language model in the intent subclass recognition model, coarse-labeled sample data can be used for pre-training. The coarse-labeled sample terms used for pre-training the semantic representation network can be sample terms that have been roughly labeled with intent subclasses manually without prior identification of the major intent categories.

[0131] In one embodiment, the pre-training steps of the semantic representation network include: obtaining coarse-labeled sample words for coarse-labeled intention subclasses; randomly masking the characters in the coarse-labeled sample words; inputting the randomly masked coarse-labeled sample words into a language model to output the classification vector representation of the coarse-labeled sample words and the semantic vector representation of the masking position; inputting the classification vector representation into a classification prediction network to obtain the prediction probability that the coarse-labeled sample words belong to each intention subclass; determining the predicted intention subclass corresponding to the coarse-labeled sample words based on each prediction probability; determining the predicted character at the masking position based on the semantic vector representation of the masking position; constructing a pre-training loss based on the difference between the labeled intention subclass and the predicted intention subclass of the coarse-labeled sample words, as well as the difference between the masked character and the predicted character; and training the language model based on the pre-training loss to obtain the pre-trained semantic representation network.

[0132] Reference Figure 9 This is a schematic diagram of the model structure for pre-training an intent subclass recognition model in one embodiment. (Refer to...) Figure 9 During each training iteration, the character vectors E1, E2, E3… corresponding to each character Tok1, Tok2, Tok3… in the coarse-labeled sample word are input into the semantic representation network. To obtain the global semantic information of the coarse-labeled sample word, the input to the semantic representation network also includes the character vector E[CLS] corresponding to the classification symbol [CLS]. After processing by multiple layers of neural networks within the semantic representation network, the semantic vector representations T1, T2, T3… corresponding to each character and the classification vector representation T[CLS] representing the global semantic information of the input coarse-labeled word are output. The semantic representation network can use BERT to vectorize short texts. Based on the semantic vector representation of the occlusion position, the predicted character at the occlusion position is determined. Furthermore, through the downstream classification prediction network, the predicted probability of the input coarse-labeled word belonging to each intent subclass is obtained based on the classification vector representation T[CLS]. The intent subclass corresponding to the highest predicted probability is taken as the predicted intent subclass to which the coarse-labeled word belongs. Finally, a pre-training loss is constructed based on the differences between the labeled intent subclass and the predicted intent subclass of the coarsely labeled sample words, as well as the differences between the masked words and the predicted words.

[0133] After completing the pre-training of the semantic representation network, such as Figure 10 The diagram illustrates the fine-tuning training steps for an intent subclass recognition model corresponding to a major target intent class in one embodiment. Specifically, these steps include:

[0134] Step 1002: Obtain sample terms that belong to the target intent category and have been labeled with intent subcategories.

[0135] Specifically, computer devices can use a pre-trained intent category recognition model to identify the intent categories of collected sample words, obtaining sample words belonging to the target intent category. Then, through manual annotation, the sample words of the target intent category are labeled with corresponding intent subcategories. All labeled intent subcategories belong to the target intent category, thus obtaining a small amount of finely labeled sample data for fine-tuning training.

[0136] Step 1004: The pre-trained semantic representation network outputs the classification vector representation of the sample word. The classification vector representation is then input into the classification prediction network. Based on the classification vector representation, the network obtains the predicted probability of the sample word belonging to each subclass of the target intent category. The predicted intent subclass corresponding to the sample word is determined based on the predicted probability.

[0137] Taking "automobile" as the target intent category as an example, after the computer device obtains sample terms belonging to the automotive domain, a small number of sample terms labeled with intent subcategories in the automotive domain are obtained through manual annotation. For example, intent subcategories can include eight subcategories such as general terms, vehicle type terms, inquiry terms, brand terms, and dealer terms. During the fine-tuning training phase, the intent subcategory recognition model is fine-tuned and trained only through the CLF task. During the training process, the network parameters of the semantic representation network and the classification prediction network are optimized simultaneously.

[0138] Specifically, the computer device directly inputs sample words belonging to the target intent category into a pre-trained semantic representation network to obtain a classification vector representation of the sample words. This classification vector representation represents the global semantic information of the input sample word. Then, the classification prediction network makes a prediction based on this classification vector representation to determine the predicted intent subclass corresponding to the sample word.

[0139] In one embodiment, a pre-trained semantic representation network is used to output a classification vector representation of a sample word, including: querying a character vector table to convert each character in the sample word into a character vector; inputting the character vector corresponding to each character and the character vector corresponding to the classification symbol into the pre-trained semantic representation network, and outputting a semantic vector representation of each character and a classification vector representation corresponding to the classification symbol. The classification vector representation is used to characterize the global semantic information of the sample word.

[0140] Specifically, the pre-trained semantic representation network includes multiple layers of convolutional operation units. The computer device inputs the character vectors corresponding to each character in the sample word and the classification symbol into the pre-trained semantic representation network. Through the layer-by-layer operation of the multiple convolutional operation units, the classification vector representation of the global semantic information of the sample word corresponding to the classification symbol is obtained.

[0141] In one embodiment, the predicted probability of a sample word belonging to each intent subclass under the target intent category is obtained by using a classification prediction network based on the classification vector representation. This includes: inputting the classification vector representation into the classification prediction network; and sequentially passing the fully connected layer and activation layer of the classification prediction network to obtain the predicted probability of the sample word belonging to each intent subclass under the target intent category.

[0142] In this embodiment, the classification prediction network consists of two fully connected layers and an activation layer:

[0143] A T =W T T[CLS]+b T ;

[0144] P G =W G tanh(A T )+b G ;

[0145] Where T[CLS] represents the classification vector representation of the global semantic information of the sample terms, and W T b represents the weight coefficient of the first fully connected layer in a classification prediction network. T Indicates the bias of the first fully connected layer, A T W represents the output of the first fully connected layer. G b represents the weight coefficient of the second fully connected layer in the classification prediction network. G P represents the bias of the second fully connected layer. G This represents the output of the second fully connected layer; tanh represents the activation function.

[0146] like Figure 11 The diagram shown is a schematic representation of the network structure of a classification prediction network in one embodiment. (Refer to...) Figure 11 The input to the classification prediction network is the classification vector representation T[CLS]. After processing by two fully connected layers and an activation layer in the network, the predicted probabilities of the sample word belonging to each subclass of the target intent category are obtained. The computer device can then use the subclass of intent with the highest predicted probability as the predicted intent subclass to which the sample word belongs.

[0147] like Figure 12The diagram illustrates the model structure for fine-tuning the intent subclass recognition model in one embodiment. Specifically, the character vectors E1, E2, E3… corresponding to each character Tok1, Tok2, Tok3… in the sample word are input into a pre-trained semantic representation network. Furthermore, to obtain the global semantic information of the sample word, the input to the semantic representation network also includes the character vector E[CLS] corresponding to the classification symbol [CLS]. After processing by multiple layers of neural networks within the semantic representation network, the semantic vector representations T1, T2, T3… corresponding to each character in the sample word and the classification vector representation T[CLS] representing the global semantic information of the input sample word are output. The semantic representation network can use BERT for vectorization of short texts. Then, through a classification prediction network, the predicted probability of the input sample word belonging to each intent subclass under the target intent category is obtained based on the classification vector representation T[CLS]. The intent subclass corresponding to the highest predicted probability is taken as the predicted intent subclass to which the sample word belongs. Finally, only the corresponding Loss_CLF is calculated based on the CLF task, and the semantic representation network and classification prediction network are fine-tuned.

[0148] Step 1006: Based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample words, the semantic representation network and the classification prediction network are trained together to obtain the intent subclass recognition model under the target intent category.

[0149] During the fine-tuning training phase, a loss for the multi-class task is constructed based on a small number of samples labeled with intent subclasses. This loss serves as the basis for optimizing the intent subclass recognition model. The network parameters of the semantic representation network and the classification prediction network are optimized simultaneously based on this loss. Once the fine-tuning training is completed, the trained intent subclass recognition model can be obtained.

[0150] In one embodiment, step 1006 includes: calculating cross-entropy based on the determined predicted intent subclass and the labeled intent subclass of the sample words to obtain the intent subclass recognition loss; with the goal of minimizing the intent subclass recognition loss, updating the network parameters of the pre-trained semantic representation network and the classification prediction network, and then returning to the step of obtaining sample words that belong to the target intent category and are labeled with intent subclasses to continue training until the training stopping condition is met.

[0151] During the fine-tuning training phase, when fine-tuning the intention subclass recognition task within the target intention category, the sample words input into the semantic representation network are accurate and belong to the target intention category. This allows for network fine-tuning training of the intention subclass recognition model with only a small number of samples, resulting in an intention subclass recognition model under the target intention category, significantly reducing the manual annotation costs required for model training. Data augmentation can also be employed during the fine-tuning training phase, specifically by adding adversarial perturbations during training to improve the model's generalization ability through adversarial training.

[0152] After pre-training the semantic representation network, fine-tuning training is required using sample words belonging to the target intent category and labeled with intent subcategories. This yields the intent subcategory recognition model corresponding to the target intent category. Thus, each intent category requires training its corresponding intent subcategory recognition model using samples from that domain. To improve the training efficiency of intent subcategory recognition models across different domains, in one embodiment, the downstream structure of the pre-trained semantic representation network can include multiple subcategories of intent categories. For example, it could simultaneously include intent subcategory recognition tasks for the automotive, education, and shopping domains. In other words, intent subcategory recognition tasks corresponding to multiple intent categories share the same pre-trained semantic representation network.

[0153] like Figure 13 As shown, multiple intent categories share the encoding of the semantic representation network, and each intent category has its own independent downstream structure for fine-tuning training. Specifically, a multi-task training approach can be adopted, and the overall loss function is set as follows:

[0154]

[0155] Where N represents the total number of intent categories, and Loss i This represents the loss for each major category of intent.

[0156] At this point, the intent subclass recognition model has completed few-shot learning.

[0157] This application also provides an intent recognition platform tool in its embodiments. For example... Figure 14 As shown, when a business needs to identify the intent of a query in a specific domain, they can define that domain and its sub-intents within the intent recognition platform tool, and provide corresponding labeled samples, such as labeling samples in that domain with first-level, second-level, third-level, and fourth-level categories, and submit them to the intent recognition platform. The intent recognition platform trains a model based on the submitted samples and saves the model. Based on the saved model, the platform can then perform intent recognition on newly submitted query data.

[0158] In one embodiment, step 302, obtaining the set of terms to be identified for intent, includes: obtaining all search terms of the resource search platform within a predetermined period; the method further includes: after obtaining the intent category and intent subcategory to which each term belongs in the full set of search terms, determining the quantity distribution of terms in each intent subcategory under each intent category; and publishing resources belonging to the corresponding intent category in the resource search platform according to the quantity distribution.

[0159] Complete processing flow as follows Figure 15 As shown. (Refer to...) Figure 15 This intent recognition tool platform includes two main functions. First, it enables classification capability building. This involves business users defining intent categories based on industry analysis needs, labeling small sample data, and submitting this data to the intent recognition platform. This creates a task to train an intent recognition model, and the training process is automatically triggered. After training, the corresponding classification model is generated. Second, it performs classification prediction on query sets. Business users can submit a query set to be classified through the intent recognition platform tool. A pre-trained model is then used for prediction. After the prediction task is completed, the statistics of the prediction results can be viewed, and the prediction results of all submitted queries can be downloaded. For example, a business user can obtain all search queries from the basic business logs for the past day on the target client, use a pre-trained model for prediction, and view the statistics of the prediction results, as well as the prediction results of sampled queries. Taking the automotive industry as an example, a user submits a query set to be classified, and the prediction results for each query are shown in the table below. The statistical distribution is as follows. Figure 16 As shown.

[0160]

[0161]

[0162] In one embodiment, a processing method for an intent recognition model is also provided, which is applied to... Figure 1Taking a computer device (such as terminal 102 or server 104) as an example, server 104 can use a trained intent category recognition model to identify the intent category of sample words, obtain the intent category to which each sample word belongs, then obtain sample words belonging to the target intent category and labeled with intent subcategories, input the sample words into a pre-trained semantic representation network to obtain the classification vector representation of the sample words, input the classification vector representation into a classification prediction network to obtain the predicted probability of each intent subcategory under the target intent category, determine the predicted intent subcategory corresponding to the sample words based on each predicted probability, and finally train the pre-trained semantic representation network and classification prediction network together based on the difference between the determined predicted intent subcategory and the labeled intent subcategory of the sample words to obtain the intent subcategory recognition model under the target intent category.

[0163] Optionally, the sample terms are input into a pre-trained semantic representation network to obtain the classification vector representation of the sample terms, including: querying the character vector table to convert each character in the sample terms into a character vector; inputting the character vector corresponding to each character and the character vector corresponding to the classification symbol into the pre-trained semantic representation network to output the semantic vector representation of each character and the classification vector representation corresponding to the classification symbol. The classification vector representation is used to characterize the global semantic information of the sample terms.

[0164] Optionally, inputting the classification vector representation into the classification prediction network to obtain the predicted probability that the sample word belongs to each intention subclass under the target intention category includes: inputting the classification vector representation into the classification prediction network; and sequentially passing the fully connected layer and activation layer of the classification prediction network to obtain the predicted probability that the sample word belongs to each intention subclass under the target intention category.

[0165] Optionally, based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample words, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain an intent subclass recognition model under the target intent category. This includes: calculating the cross-entropy based on the determined predicted intent subclass and the labeled intent subclass of the sample words to obtain the intent subclass recognition loss; updating the network parameters of the pre-trained semantic representation network and the classification prediction network with the goal of minimizing the intent subclass recognition loss, and then returning to the step of obtaining sample words that belong to the target intent category and are labeled with intent subclasses to continue training until the training stopping condition is met.

[0166] For a description and implementation of each step of the intent recognition model processing method, please refer to the previous description of the training steps of the intent subclass recognition model. In training the intent subclass recognition model, the processing method first uses a pre-trained intent category recognition model to identify the intent category of each sample word. Since the intent categories of the training samples have already been identified, training the intent subclass recognition model under the target intent category only requires a small number of sample words that all belong to the target intent category and have been labeled with intent subclasses. Specifically, these sample words are input into a pre-trained semantic representation network to obtain the classification vector representation of the sample words. Then, the classification vector representation is input into a classification prediction network to obtain the predicted probability that the sample word belongs to each intent subclass under the target intent category. Based on each predicted probability, the predicted intent subclass corresponding to the sample word is determined. Finally, based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample word, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain the intent subclass recognition model under the target intent category. Since all the sample words input into the network belong to the target intent category, only a small number of samples are needed for fine-tuning the network to obtain an intent subclass recognition model under the target intent category, saving manual annotation costs. Furthermore, the trained intent subclass recognition model under the target intent category, combined with the trained intent category recognition model, can be used to comprehensively identify the corresponding intent category and intent subclass for word sets composed of words from various domains, improving intent recognition efficiency.

[0167] In one specific embodiment, the intent recognition method includes the following steps:

[0168] Obtain sample terms that have been labeled with their intended major categories;

[0169] Sample terms belonging to the same major intent category are divided into a support set and a query set;

[0170] For each intent category, the sample terms from the corresponding support set and query set are input into the intent category recognition model to obtain the vectorized representation of each sample term. Based on the vectorized representation of each sample term in the support set, the prototype representation of the intent for each intent category is determined.

[0171] For each intent category, calculate the distance between the vectorized representation of the sample terms in the corresponding query set and the prototype representation of the intent category, and take the intent category corresponding to the prototype representation of the minimum distance as the predicted intent category of the sample terms.

[0172] Based on the predicted intent category and the labeled intent subclass of the sample words, calculate the cross-entropy to obtain the cross-entropy loss for each intent category;

[0173] The cross-entropy loss of each intent category is summed to obtain the intent category recognition loss;

[0174] Optimize the intent category recognition model based on the intent category recognition loss;

[0175] Obtain coarse label sample words of coarse label subclasses, randomly mask the words in the coarse label sample words, input the randomly masked coarse label sample words into the language model, and output the classification vector representation and the semantic vector representation of the masking position of the coarse label sample words;

[0176] The classification vector representation is input into the classification prediction network to obtain the predicted probability of the coarse-labeled sample word belonging to each intent subclass. The predicted intent subclass corresponding to the coarse-labeled sample word is determined based on the predicted probability. The predicted word at the occlusion position is determined based on the semantic vector representation of the occlusion position.

[0177] Based on the differences between the labeled intent subclass and the predicted intent subclass of the coarsely labeled sample words, as well as the differences between the masked words and the predicted words, a pre-training loss is constructed.

[0178] The language model is trained based on the pre-training loss to obtain the pre-trained semantic representation network;

[0179] Obtain sample terms that belong to the target intent category and have been labeled with intent subcategories;

[0180] By querying the character vector table, each character in the sample word entry is converted into a character vector;

[0181] The character vector corresponding to each character and the character vector corresponding to the classification symbol are input into the pre-trained semantic representation network, which outputs the semantic vector representation of each character and the classification vector representation corresponding to the classification symbol. The classification vector representation is used to represent the global semantic information of the sample word.

[0182] The classification vector representation is input into the classification prediction network. The network then passes through the fully connected layer and activation layer of the classification prediction network to obtain the predicted probability of each intention subclass under the target intention category. Based on the predicted probability, the predicted intention subclass corresponding to the sample word is determined.

[0183] Based on the determined predicted intent subclass and the labeled intent subclass of the sample words, the cross-entropy is calculated to obtain the intent subclass recognition loss;

[0184] With the goal of minimizing the loss of intent subclass recognition, after updating the network parameters of the pre-trained semantic representation network and classification prediction network, the process returns to the step of obtaining sample words that belong to the target intent category and are labeled with intent subclasses to continue training until the training stopping condition is met, thus obtaining the intent subclass recognition model under the target intent category.

[0185] Obtain the set of terms to be identified for intent recognition;

[0186] By using a trained intent category recognition model, intent category recognition is performed on each word in the word set to obtain the intent category to which each word in the word set belongs.

[0187] For words in the word set that belong to the target intent category, the intent subclass recognition model corresponding to the target intent category is trained to identify the intent subclass of the words belonging to the target intent category, and the intent subclass to which the words belonging to the target intent category belong is obtained. Each intent subclass belongs to the target intent category.

[0188] The aforementioned intent recognition method, when training the intent subclass recognition model, first uses a pre-trained intent category recognition model to identify the intent categories of sample words, thus obtaining the intent category to which each sample word belongs. Since the intent categories of the training samples have already been identified, training the intent subclass recognition model under the target intent category only requires a small number of sample words that all belong to the target intent category and have already been labeled with intent subclasses, saving manual labeling costs. Furthermore, combining the pre-trained intent subclass recognition model under the target intent category with the pre-trained intent category recognition model allows for comprehensive identification of the corresponding intent categories and subclasses for word sets composed of words from various different domains, improving intent recognition efficiency.

[0189] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0190] Based on the same inventive concept, this application also provides an intent recognition device for implementing the intent recognition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more intent recognition device embodiments provided below can be found in the limitations of the intent recognition method described above, and will not be repeated here.

[0191] In one embodiment, such as Figure 17As shown, an intent recognition device 1700 is provided, including: an acquisition module 1702, an intent category recognition module 1704, and an intent subcategory recognition module 1706, wherein:

[0192] The acquisition module 1702 is used to acquire a set of words to be identified for intent recognition;

[0193] The intent category recognition module 1704 is used to perform intent category recognition on each word in the word set using a trained intent category recognition model, so as to obtain the intent category to which each word in the word set belongs.

[0194] The intent subclass recognition module 1706 is used to identify the intent subclass of words belonging to the target intent category in the word set by using a trained intent subclass recognition model corresponding to the target intent category, and to obtain the intent subclass to which the words belonging to the target intent category belong. Each intent subclass belongs to the target intent category.

[0195] In one embodiment, the intent category recognition module is further configured to input the word into the trained intent category recognition model, output the vectorized representation of the word, calculate the distance between the vectorized representation of the word and the intent prototype representation of each intent category, normalize each distance, and take the intent category corresponding to the intent prototype representation with the smallest normalized distance as the intent category to which the word belongs.

[0196] In one embodiment, the apparatus further includes an intent prototype representation determination module, used to acquire sample words of labeled intent categories used when training the intent category recognition model, divide sample words belonging to the same intent category into a support set and a query set, input the corresponding sample words in the support set into the trained intent category recognition model for each intent category, obtain the vectorized representation of each sample word in the support set, calculate the mean of the vectorized representation of each sample word in the support set, and obtain the intent prototype representation of each intent category.

[0197] In one embodiment, the intent subclass recognition module is further configured to obtain a trained intent subclass recognition model corresponding to the target intent category, query a character vector table, convert each character in the word into a character vector, obtain the classification vector representation of the word based on the character vector through the semantic representation network in the intent subclass recognition model, the classification vector representation is used to characterize the global semantic information of the word, obtain the predicted probability of the word belonging to each intent subclass under the target intent category through the classification prediction network in the intent subclass recognition model based on the classification vector representation, and determine the intent subclass to which the word belongs based on the predicted probability.

[0198] In one embodiment, the apparatus further includes:

[0199] The first training module is used to acquire sample terms belonging to labeled intent categories. Sample terms belonging to the same intent category are divided into a support set and a query set. For each intent category, the sample terms from the corresponding support set and query set are input into the intent category recognition model to obtain the vectorized representation of each sample term. Based on the vectorized representation of each sample term in the support set, the intent prototype representation of each intent category is determined. The intent category recognition loss is constructed with the goal of minimizing the difference between the vectorized representation of the sample terms in the corresponding query set and the intent prototype representation of the labeled intent category, and maximizing the difference between the vectorized representation of the sample terms and the intent prototype representation of intent categories other than the labeled intent category. The intent category recognition model is optimized based on the intent category recognition loss.

[0200] In one embodiment, the first training module is further configured to, for each intent category, calculate the distance between the vectorized representation of the sample word in the corresponding query set and the intent prototype representation of each intent category, and take the intent category corresponding to the intent prototype representation with the smallest distance as the predicted intent category corresponding to the sample word; calculate the cross-entropy based on the predicted intent category and the labeled intent subclass of the sample word to obtain the cross-entropy loss of each intent category; and sum the cross-entropy losses of each intent category to obtain the intent category recognition loss.

[0201] In one embodiment, the apparatus further includes:

[0202] The second training module is used to acquire sample words belonging to the target intent category and whose intent subcategories have been labeled. Through a pre-trained semantic representation network, it outputs the classification vector representation of the sample words. The classification vector representation is input into the classification prediction network. Based on the classification vector representation, the classification prediction network obtains the predicted probability that the sample words belong to each intent subcategory under the target intent category. Based on each predicted probability, the predicted intent subcategory corresponding to the sample words is determined. Based on the difference between the determined predicted intent subcategory and the labeled intent subcategory of the sample words, the semantic representation network and the classification prediction network are jointly trained to obtain the intent subcategory recognition model under the target intent category.

[0203] In one embodiment, the second training module is further configured to query the character vector table, convert each character in the sample word into a character vector, input the character vector corresponding to each character and the character vector corresponding to the classification symbol into a pre-trained semantic representation network, and output the semantic vector representation of each character and the classification vector representation corresponding to the classification symbol. The classification vector representation is used to characterize the global semantic information of the sample word.

[0204] In one embodiment, the second training module is further configured to input the classification vector representation into the classification prediction network; and sequentially pass through the fully connected layer and activation layer of the classification prediction network to obtain the predicted probability that the sample word belongs to each intention subclass under the target intention category.

[0205] In one embodiment, the second training module is further configured to calculate the cross-entropy based on the determined predicted intent subclass and the labeled intent subclass of the sample words, and obtain the intent subclass recognition loss; with the goal of minimizing the intent subclass recognition loss, after updating the network parameters of the pre-trained semantic representation network and the classification prediction network, return to the step of obtaining sample words that belong to the target intent category and are labeled with intent subclasses to continue training until the training stopping condition is met.

[0206] In one embodiment, the second training module further includes a pre-training submodule, used to obtain coarse-labeled sample words of coarse-labeled intention subclasses; after randomly masking the characters in the coarse-labeled sample words, input the randomly masked coarse-labeled sample words into a language model, and output the classification vector representation of the coarse-labeled sample words and the semantic vector representation of the masking position; input the classification vector representation into a classification prediction network to obtain the prediction probability of the coarse-labeled sample words belonging to each intention subclass, and determine the predicted intention subclass corresponding to the coarse-labeled sample words based on each prediction probability; determine the predicted character at the masking position based on the semantic vector representation of the masking position; construct a pre-training loss based on the difference between the labeled intention subclass and the predicted intention subclass of the coarse-labeled sample words, as well as the difference between the masked character and the predicted character; and train the language model based on the pre-training loss to obtain a pre-trained semantic representation network.

[0207] In one embodiment, the acquisition module is further configured to acquire all search terms of the resource search platform within a predetermined period; the apparatus further includes: a resource publishing module, configured to determine the quantity distribution of terms in each intent subclass under each intent category after obtaining the intent category and intent subclass to which each term belongs in the full set of search terms; and to publish resources belonging to the corresponding intent category in the resource search platform according to the quantity distribution.

[0208] The aforementioned intent recognition device, after acquiring the set of terms to be identified, first uses a trained intent category recognition model to identify the intent category to which each term belongs for each term in the set. For terms belonging to the same target intent category, it further uses the corresponding intent subcategory recognition model under that target intent category to identify the intent subcategory to which the term belongs. Thus, compared to related technologies that can only identify the intent subcategory to which terms belong in a specific domain, this application can comprehensively identify the corresponding intent categories and intent subcategories for a set of terms composed of terms from different domains, improving intent recognition efficiency.

[0209] Based on the same inventive concept, this application also provides an intent recognition device for implementing the intent recognition model processing method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations of one or more intent recognition model processing device embodiments provided below can be found in the limitations of the intent recognition model processing method described above, and will not be repeated here.

[0210] In one embodiment, such as Figure 18 As shown, a processing device 1800 for an intent recognition model is provided, including: an acquisition module 1802, a prediction module 1804, and an update module 1806, wherein:

[0211] The acquisition module 1802 is used to identify the intent category of sample words through a trained intent category recognition model, obtain the intent category to which each sample word belongs, and acquire sample words that belong to the target intent category and have been labeled with intent subclasses.

[0212] The prediction module 1804 is used to input the sample word into the pre-trained semantic representation network to obtain the classification vector representation of the sample word, input the classification vector representation into the classification prediction network to obtain the prediction probability of the sample word belonging to each intention subclass under the target intention category, and determine the predicted intention subclass corresponding to the sample word based on each prediction probability.

[0213] The update module 1806 is used to train the pre-trained semantic representation network and the classification prediction network together based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample words, so as to obtain the intent subclass recognition model under the target intent category.

[0214] In one embodiment, the prediction module 1804 is further configured to query a character vector table, convert each character in the sample word into a character vector, input the character vector corresponding to each character and the character vector corresponding to the classification symbol into a pre-trained semantic representation network, and output the semantic vector representation of each character and the classification vector representation corresponding to the classification symbol. The classification vector representation is used to characterize the global semantic information of the sample word.

[0215] In one embodiment, the prediction module 1804 is further configured to input the classification vector representation into the classification prediction network; and obtain the predicted probability that the sample word belongs to each intention subclass under the target intention category by sequentially passing through the fully connected layer and activation layer of the classification prediction network.

[0216] In one embodiment, the update module 1806 is further configured to calculate the cross-entropy based on the determined predicted intent subclass and the labeled intent subclass of the sample words, and obtain the intent subclass recognition loss; with the goal of minimizing the intent subclass recognition loss, after updating the network parameters of the pre-trained semantic representation network and the classification prediction network, return to the step of obtaining sample words that belong to the target intent category and are labeled with intent subclasses to continue training until the training stopping condition is met.

[0217] The processing device of the aforementioned intent recognition model, when training the intent subclass recognition model, first uses the pre-trained intent major class recognition model to perform intent major class recognition on the sample words, obtaining the intent major class to which each sample word belongs. Since the intent major class of the training samples has already been identified, training the intent subclass recognition model under the target intent major class only requires a small number of sample words that all belong to the target intent major class and have been labeled with intent subclasses. Specifically, these sample words are input into a pre-trained semantic representation network to obtain the classification vector representation of the sample words. Then, the classification vector representation is input into a classification prediction network to obtain the predicted probability that the sample words belong to each intent subclass under the target intent major class. Based on each predicted probability, the predicted intent subclass corresponding to the sample words is determined. Finally, based on the difference between the determined predicted intent subclass and the labeled intent subclass of the sample words, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain the intent subclass recognition model under the target intent major class. Since all the sample words input into the network belong to the target intent category, only a small number of samples are needed to fine-tune the network training and obtain the intent subclass recognition model under the target intent category, saving the cost of manual annotation.

[0218] Each module in the above-mentioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0219] In one embodiment, a computer device is provided, the computer device may be... Figure 1 The internal structure diagram of the terminal or server shown can be as follows: Figure 19As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external servers or terminals via a network connection. When the computer program is executed by the processor, it implements an intent recognition method or intent recognition model processing method.

[0220] When the computer device is a server, its non-volatile storage medium also stores a database. When the computer device is a terminal, it may further include a display unit and an input device connected to a system bus. The display unit of the computer device is used to form a visually visible image and may be a display screen, a projection device, or a virtual reality imaging device. The display screen may be a liquid crystal display screen or an e-ink display screen. The input device of the computer device may be a touch layer covering the display screen, or buttons, a trackball, or a touchpad provided on the computer device casing, or an external keyboard, touchpad, or mouse, etc.

[0221] Those skilled in the art will understand that Figure 19 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0222] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the processing method of the intent recognition method or intent recognition model described in the above embodiments.

[0223] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the processing method of the intent recognition method or intent recognition model described in the above embodiments.

[0224] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the processing method for the intent recognition method or intent recognition model described in the above embodiments.

[0225] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0226] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0227] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0228] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An intent recognition method, characterized in that, The method includes: Sample terms labeled with the same intent category are divided into a support set and a query set. For each intent category, the sample terms from the corresponding support set and query set are input into the intent category recognition model to obtain the vectorized representation of each sample term. Based on the vectorized representation of each sample term in the support set, the intent prototype representation of each intent category in the current training state is determined. The intent category recognition model is optimized with the goal of minimizing the difference between the vectorized representation of the sample terms in the corresponding query set and the intent prototype representation of the labeled intent category, and maximizing the difference between the vectorized representation of the sample terms and the intent prototype representation of intent categories other than the labeled intent category. After obtaining the trained intent category recognition model, the intent prototype representation of each intent category is determined based on the vectorized representation of the sample terms in the corresponding support set for each intent category. Using a trained intent category recognition model, intent category recognition is performed on sample words to obtain sample words belonging to the target intent category. Based on the sample words of the target intent category, finely labeled sample words belonging to the target intent category and annotated with intent subclasses are obtained. The intent subclasses to which the finely labeled sample words belong are manually labeled. The intent subclass recognition model is updated based on the finely labeled sample words to obtain a trained intent subclass recognition model under the target intent category. Obtain the set of terms to be identified for intent recognition; The terms in the term set are input into a trained intent category recognition model, which outputs a vectorized representation of each term. The intent category to which each term belongs is determined based on the distance between the vectorized representation of the term and the intent prototype representation of each intent category. The intent category represents the domain to which the term belongs. For terms in the term set that belong to the target intent category, the intent subclass recognition is performed on the terms belonging to the target intent category using a trained intent subclass recognition model corresponding to the target intent category. This yields the intent subclass to which the terms belonging to the target intent category belong. Each intent subclass is a subdivided intent within the target intent category.

2. The method according to claim 1, characterized in that, The step of determining the intent category to which each term belongs based on the distance between the vectorized representation of the term and the prototype representation of each intent category includes: Calculate the distance between the vectorized representation of the term and the prototype representation of each intent category. After normalizing each distance, the intent category corresponding to the prototype representation with the smallest normalized distance is taken as the intent category to which the term belongs.

3. The method according to claim 2, characterized in that, After obtaining the trained intent category recognition model, the intent prototype representation of each intent category is determined based on the vectorized representation of the sample words in the corresponding support set for each intent category, including: Obtain the labeled sample words of the intent categories used when training the intent category recognition model; Sample terms belonging to the same major intent category are divided into a support set and a query set; For each intent category, the corresponding sample terms from the support set are input into the trained intent category recognition model to obtain the vectorized representation of each sample term in the support set. The mean of the vectorized representation of each sample term in the support set is calculated to obtain the prototype representation of each intent category.

4. The method according to claim 1, characterized in that, The step of using a trained intent subclass recognition model corresponding to the target intent category to perform intent subclass recognition on the words belonging to the target intent category, and obtaining the intent subclass to which the words belonging to the target intent category belong, includes: Obtain the trained intent subclass recognition model corresponding to the target intent category; The word vector table is queried, and each character in the term is converted into a word vector. Then, the semantic representation network in the intent subclass recognition model is used to obtain the classification vector representation of the term based on the word vector. The classification vector representation is used to characterize the global semantic information of the term. By using the classification prediction network in the intent subclass recognition model, the predicted probability of the word belonging to each intent subclass under the target intent category is obtained according to the classification vector representation. The intent subclass to which the term belongs is determined based on the predicted probability.

5. The method according to claim 1, characterized in that, The optimization of the intent category recognition model aims to minimize the difference between the vectorized representation of sample terms in the corresponding query set and the intent prototype representation of the labeled intent category of the sample terms, and to maximize the difference between the vectorized representation of sample terms and the intent prototype representation of intent categories other than the labeled intent category. This includes: For each intent category, calculate the distance between the vectorized representation of the sample terms in the corresponding query set and the prototype representation of each intent category. The intent category corresponding to the prototype representation with the smallest distance is taken as the predicted intent category for the sample term. Based on the predicted intent category and the labeled intent subclass of the sample term, calculate the cross-entropy to obtain the cross-entropy loss for each intent category. Sum the cross-entropy losses of each intent category to obtain the intent category recognition loss. Optimize the intent category recognition model based on the intent category recognition loss.

6. The method according to claim 1, characterized in that, The step of updating the intent subclass recognition model based on the precise sample terms includes: The classification vector representation of the finely labeled sample word is output through a pre-trained semantic representation network. The classification vector representation is input into a classification prediction network. The classification prediction network obtains the prediction probability of the finely labeled sample word belonging to each intention subclass under the target intention category based on the classification vector representation. The predicted intention subclass corresponding to the finely labeled sample word is determined based on each prediction probability. Based on the difference between the determined predicted intent subclass and the labeled intent subclass of the precise sample terms, the semantic representation network and the classification prediction network are updated together.

7. The method according to claim 6, characterized in that, The process of outputting the classification vector representation of the precisely labeled sample terms through a pre-trained semantic representation network includes: Query the character vector table to convert each character in the precise labeled sample terms into a character vector; The character vector corresponding to each character and the character vector corresponding to the classification symbol are input into the pre-trained semantic representation network, which outputs the semantic vector representation of each character and the classification vector representation corresponding to the classification symbol. The classification vector representation is used to characterize the global semantic information of the precise labeled sample words.

8. The method according to claim 6, characterized in that, The step of obtaining the predicted probability that the precisely labeled sample term belongs to each intent subclass under the target intent category through the classification prediction network and based on the classification vector representation includes: The classification vector representation is input into the classification prediction network; By sequentially processing the fully connected layer and activation layer of the classification prediction network, the predicted probability of the precise labeled sample word belonging to each intent subclass under the target intent category is obtained.

9. The method according to claim 6, characterized in that, The step of updating the semantic representation network and the classification prediction network together based on the difference between the determined predicted intent subclass and the labeled intent subclass of the precise labeled sample words includes: Based on the determined predicted intent subclass and the labeled intent subclass of the fine-marked sample words, the cross-entropy is calculated to obtain the intent subclass recognition loss; With the goal of minimizing the loss of the intent subclass recognition, after updating the network parameters of the pre-trained semantic representation network and the classification prediction network, the process returns to the step of obtaining the finely labeled sample words that belong to the target intent category and are labeled with intent subclasses to continue training until the training stopping condition is met.

10. The method according to claim 6, characterized in that, The pre-training steps of the semantic representation network include: Obtain coarse label sample words of coarse label subclasses, randomly mask the words in the coarse label sample words, input the randomly masked coarse label sample words into the language model, and output the classification vector representation and the semantic vector representation of the masking position of the coarse label sample words. The classification vector representation is input into the classification prediction network to obtain the predicted probability that the coarse-labeled sample word belongs to each intent subclass. The predicted intent subclass corresponding to the coarse-labeled sample word is determined according to each predicted probability. The predicted word at the occlusion position is determined according to the semantic vector representation of the occlusion position. Based on the difference between the labeled intention subclass and the predicted intention subclass of the coarse-labeled sample words, and the difference between the masked word and the predicted word, a pre-training loss is constructed; The language model is trained based on the pre-training loss to obtain a pre-trained semantic representation network.

11. The method according to any one of claims 1 to 10, characterized in that, The process of obtaining the set of terms to be identified for intent recognition includes: Obtain all search terms from the resource search platform within the predetermined period; The method further includes: After obtaining the intent category and intent subcategory to which each term belongs in the full search term list, determine the number distribution of terms in each intent subcategory under each intent category; In the resource search platform, resources belonging to the corresponding intent category are published according to the quantity distribution.

12. A processing method for an intent recognition model, characterized in that, The method includes: Sample terms labeled with the same intent category are divided into a support set and a query set. For each intent category, the sample terms from the corresponding support set and query set are input into the intent category recognition model to obtain the vectorized representation of each sample term. Based on the vectorized representation of each sample term in the support set, the intent prototype representation of each intent category in the current training state is determined. The intent category recognition model is optimized with the goal of minimizing the difference between the vectorized representation of the sample terms in the corresponding query set and the intent prototype representation of the labeled intent category, and maximizing the difference between the vectorized representation of the sample terms and the intent prototype representation of intent categories other than the labeled intent category. After obtaining the trained intent category recognition model, the intent prototype representation of each intent category is determined based on the vectorized representation of the sample terms in the corresponding support set for each intent category. By using a trained intent category recognition model, the intent categories of sample words are identified to obtain the intent categories to which each sample word belongs. Based on the sample words belonging to the target intent category, finely labeled sample words belonging to the target intent category and marked with intent subcategories are obtained. The intent subcategories to which the finely labeled sample words belong are manually labeled. The precise labeled sample terms are input into a pre-trained semantic representation network to obtain the classification vector representation of the precise labeled sample terms. The classification vector representation is then input into a classification prediction network to obtain the prediction probability that the precise labeled sample terms belong to each intention subclass under the target intention category. Based on each prediction probability, the predicted intention subclass corresponding to the precise labeled sample terms is determined. Based on the difference between the determined predicted intent subclass and the labeled intent subclass of the precise sample words, the pre-trained semantic representation network and the classification prediction network are jointly trained to obtain the intent subclass recognition model under the target intent category.

13. An intent recognition device, characterized in that, The device includes: The first training module is used to divide sample terms labeled with the same intent category into a support set and a query set. For each intent category, the sample terms from the corresponding support set and query set are input into the intent category recognition model to obtain the vectorized representation of each sample term. Based on the vectorized representation of each sample term in the support set, the intent prototype representation of each intent category in the current training state is determined. The intent category recognition model is optimized with the goal of minimizing the difference between the vectorized representation of the sample terms in the corresponding query set and the intent prototype representation of the labeled intent category, and maximizing the difference between the vectorized representation of the sample terms and the intent prototype representation of intent categories other than the labeled intent category. After obtaining the trained intent category recognition model, the intent prototype representation of each intent category is determined based on the vectorized representation of the sample terms in the corresponding support set for each intent category. The second training module is used to use the trained intent category recognition model to perform intent category recognition on sample words to obtain sample words belonging to the target intent category. Based on the sample words of the target intent category, it obtains finely labeled sample words belonging to the target intent category and labeled with intent subclasses. The intent subclasses to which the finely labeled sample words belong are manually labeled. Based on the finely labeled sample words, the intent subclass recognition model is updated to obtain the trained intent subclass recognition model under the target intent category. The acquisition module is used to acquire a set of terms to be identified for intent recognition; The intent category recognition module is used to input the words in the word set into the trained intent category recognition model, output the vectorized representation of the words, and determine the intent category to which each word belongs based on the distance between the vectorized representation of the word and the intent prototype representation of each intent category. The intent category represents the domain to which the word belongs. The intent subclass recognition module is used to identify the intent subclass of the words belonging to the target intent category in the word set by using a trained intent subclass recognition model corresponding to the target intent category, and to obtain the intent subclass to which the words belonging to the target intent category belong. Each intent subclass belongs to the target intent category and is a subdivided intent of its respective domain.

14. A processing apparatus for an intent recognition model, characterized in that, The device includes: The first training module is used to divide sample terms labeled with the same intent category into a support set and a query set. For each intent category, the sample terms from the corresponding support set and query set are input into the intent category recognition model to obtain the vectorized representation of each sample term. Based on the vectorized representation of each sample term in the support set, the intent prototype representation of each intent category in the current training state is determined. The intent category recognition model is optimized with the goal of minimizing the difference between the vectorized representation of the sample terms in the corresponding query set and the intent prototype representation of the labeled intent category, and maximizing the difference between the vectorized representation of the sample terms and the intent prototype representation of intent categories other than the labeled intent category. After obtaining the trained intent category recognition model, the intent prototype representation of each intent category is determined based on the vectorized representation of the sample terms in the corresponding support set for each intent category. The acquisition module is used to identify the intent category of sample words through a trained intent category recognition model, obtain the intent category to which each sample word belongs, and obtain finely labeled sample words belonging to the target intent category and labeled with intent subclasses based on the sample words belonging to the target intent category. The intent subclasses to which the finely labeled sample words belong are manually labeled. The prediction module is used to input the finely labeled sample terms into a pre-trained semantic representation network to obtain the classification vector representation of the finely labeled sample terms, input the classification vector representation into a classification prediction network to obtain the prediction probability that the finely labeled sample terms belong to each intention subclass under the target intention category, and determine the predicted intention subclass corresponding to the finely labeled sample terms based on each prediction probability. The update module is used to train the pre-trained semantic representation network and the classification prediction network together based on the difference between the determined predicted intent subclass and the labeled intent subclass of the precise sample words, so as to obtain the intent subclass recognition model under the target intent category.

15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 13.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.

17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Query intention mining and query intention recognition methods and devices

    CN108804532A

  • Sample data processing method, sample data processing device and electronic equipment

    CN111198938A