Intention classification method and device, electronic equipment and storage medium

By obtaining the problem text and target business identification, combining the candidate intent category description and specific intent classification requirements in the target prompt text, the first major language model and intent classification model are used to perform dual intent classification, solving the problem of low accuracy in intent classification. Accuracy of intent categories and accuracy of responses is achieved.

CN119311890APending Publication Date: 2025-01-14TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411350686.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

In the prior art, the accuracy of intention classification is not high, and it is difficult to accurately understand the user's question text, resulting in inaccurate reply.

Method used

By obtaining problem text and target business identification, combining the candidate intent category description and specific intent classification requirements in the target prompt text, use the first major language model and intent classification model to perform dual intent classification, determine the target intent category of the problem text, and ensure classification Accuracy of the results.

Benefits of technology

Significantly improve the accuracy of intent classification, ensuring the certainty of intent categories of question text, thereby improving the accuracy of responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311890A_ABST
    Figure CN119311890A_ABST
Patent Text Reader

Abstract

The invention provides an intention classification method and device, electronic equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps: obtaining a question text and a target business identifier of a target business from which the question text is sourced; obtaining a target prompt text associated with the target service identifier; performing intention classification on the question text by the first large language model according to the target prompt text, and determining a first candidate intention category to which the question text belongs in a plurality of candidate intention categories; performing intention classification on the question text by an intention classification model, and determining a second candidate intention category to which the question text belongs in a plurality of candidate intention categories according to an intermediate intention classification result output by the intention classification model; and according to the first candidate intention category and the second candidate intention category, determining a target intention category of the question text under the target business. According to the method, the accuracy of the intention category determined for the intention text can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an intent classification method, device, electronic device and storage medium. Background Art

[0002] In the automatic question-answering scenario, after receiving the question text sent by the user, it is necessary to first classify the intent of the recognized question text, and then accurately understand the question text and generate a reply to the question text based on the intent classification result. In the related art, there is a problem of low accuracy of intent classification. Therefore, how to improve the accuracy of intent classification is a technical problem that needs to be solved urgently in the related art. Summary of the invention

[0003] In view of this, an embodiment of the present application proposes an intent classification method, device, electronic device and storage medium to improve the accuracy of intent classification.

[0004] In a first aspect, an embodiment of the present application provides an intent classification method, comprising: obtaining a question text and a target business identifier of a target business from which the question text originates; obtaining a target prompt text associated with the target business identifier; the target prompt text comprising a plurality of candidate intent categories of the target business, an intent category description of each candidate intent category, and specific intent classification requirements under the target business; using a first large language model to perform intent classification on the question text according to the plurality of candidate intent categories, the intent category description of each candidate intent category, and the specific intent classification requirements under the target business, and determining a first candidate intent category to which the question text belongs among the plurality of candidate intent categories; using an intent classification model to perform intent classification on the question text, and determining a second candidate intent category to which the question text belongs among the plurality of candidate intent categories according to an intermediate intent classification result output by the intent classification model; and determining a target intent category for the question text under the target business according to the first candidate intent category and the second candidate intent category.

[0005] In the second aspect, an embodiment of the present application provides an intent classification device, including: a first acquisition module, used to obtain a question text and a target business identifier of a target business from which the question text originates; a second acquisition module, used to obtain a target prompt text associated with the target business identifier; the target prompt text includes multiple candidate intent categories of the target business, intent category descriptions of each candidate intent category, and specific intent classification requirements under the target business; a first classification module, used to perform intent classification on the question text according to multiple candidate intent categories, intent category descriptions of each candidate intent category, and specific intent classification requirements under the target business by a first large language model, and determine the first candidate intent category to which the question text belongs among the multiple candidate intent categories; a second classification module, used to perform intent classification on the question text by an intent classification model, and determine the second candidate intent category to which the question text belongs among the multiple candidate intent categories according to the intermediate intent classification result output by the intent classification model; an intent category determination module, used to determine the target intent category of the question text under the target business according to the first candidate intent category and the second candidate intent category.

[0006] In some embodiments, the intent classification model is applicable to multiple businesses; the second classification module includes: a first classification unit, which is used to perform intent classification on the question text by the intent classification model, and obtain an intermediate intent classification result output by the intent classification model for the question text in the candidate intent set of multiple businesses, and the intermediate intent classification result includes the probability that the question text belongs to each intent category in the candidate intent set of multiple businesses; a first probability determination unit, which is used to obtain the probability that the question text belongs to each candidate intent category under the target business in the intermediate intent classification result; a second candidate intent category determination unit, which is used to determine the second candidate intent category to which the question text belongs among the multiple candidate intent categories under the target business according to the probability that the question text belongs to each candidate intent category under the target business.

[0007] In some embodiments, the second candidate intent category determination unit is further used to: use a target classification model trained for the target business to perform probability prediction on each candidate intent category based on the probability that the question text belongs to each candidate intent category of the target business and the question text, to obtain a prediction result, wherein the prediction result is used to indicate the probability of each candidate intent category being the intent category to which the question text belongs; based on the prediction result, the candidate intent category with the highest probability of being the intent category to which the question text belongs is determined as the second candidate intent category.

[0008] In some embodiments, the intent classification model includes a base model and multiple low-rank adaptive expert networks, one low-rank adaptive expert network corresponds to one of multiple businesses; the second classification module includes: a first feature extraction unit, used to extract features from the question text by the base model to obtain a first text feature; an activation information output unit, used to output activation information by the gating network according to the question text and the target business identifier, the activation information is used to indicate the activation probability of each low-rank adaptive expert network; an expert network determination unit, used to determine the low-rank adaptive expert network corresponding to the target business among multiple low-rank adaptive expert networks; a second feature extraction unit, used to extract features from the question text by the low-rank adaptive expert network corresponding to the target business to obtain a second text feature; an intermediate intent classification result output unit, used to perform intent classification according to the weighted result of the first text feature and the second text feature to obtain an intermediate intent classification result, the intermediate intent classification result indicates the second candidate intent category to which the question text belongs among multiple candidate intent categories.

[0009] In some embodiments, the intent category determination module is further used to: vote on the candidate intent categories in the candidate set, and determine the target intent category of the question text under the target business based on the voting results; the candidate set includes a first candidate intent category and a second candidate intent category.

[0010] In some embodiments, the candidate set also includes a third candidate intent category to which the question text belongs among multiple candidate intent categories; the intent classification device also includes: a retrieval module, used to retrieve candidate sample question texts that are semantically similar to the question text in a question library corresponding to the target business, the question library corresponding to the target business including multiple sample question texts stored in association with the candidate intent categories under the target business; a third candidate intent category determination module, used to determine the third candidate intent category to which the question text belongs among multiple candidate intent categories based on the candidate intent category associated with the candidate sample question text.

[0011] In some embodiments, the intent classification device also includes: a third acquisition module, used to obtain a question type description text for a target business; a first question generation module, used to generate a question according to a question generation prompt text and a question type description text by a second language model, and obtain a sample question text that conforms to the question type description text; a fourth classification module, used to perform intent classification on the sample question text according to intent classification prompt texts and question type description texts through multiple different third language models, and obtain multiple intent classification results for the sample question text; a second intent category determination module, used to determine the target intent category to which the sample question text belongs from the multiple intent classification results of the sample question text; and a first association storage module, used to associate and store the sample question text and the target intent category to which the sample question text belongs in a question library corresponding to the target business.

[0012] In some embodiments, the intent classification device also includes: a rewriting module, which is used to rewrite the sample question text to obtain a rewritten question text; a fifth classification module, which is used to perform intent classification on the rewritten question text according to the corresponding intent classification prompt text and the question type description text through multiple different third language models, and obtain multiple intent classification results of the rewritten question text; a third intent category determination module, which is used to determine the target intent category to which the rewritten question text belongs from the multiple intent classification results of the rewritten question text; and a second association storage module, which is used to associate and store the rewritten question text and the target intent category to which the rewritten question text belongs in a question library corresponding to the target business.

[0013] In some embodiments, the target prompt text also includes question examples for each candidate intent category; the intent classification device also includes: a fourth acquisition module, used to obtain a new intent category for the target business, and a second question type description text annotated for the new intent category; a second question generation module, used to generate questions based on the question generation prompt text and the new question type description text by the second largest language model, to obtain a second sample question text that conforms to the new question type description text; a third associated storage module, used to associate and store the second sample question text and the new intent category in a question library corresponding to the target business; a first adding module, used to add the second sample question text, the new intent category and the intent category description annotated for the new intent category to the target prompt text, wherein the second sample question text is used as a question example of the new intent category in the target prompt text.

[0014] In some embodiments, the target prompt text also includes question examples for each candidate intent category; the intent classification device also includes: a fifth acquisition module, used to obtain bad example question text from the target business; a sixth acquisition module, used to obtain the marked intent category marked for the bad example question text, and the intent category description marked for the marked intent category; a fourth associated storage module, used to associate the bad example question text and the corresponding marked intent category and store them in the question library corresponding to the target business; a second adding module, used to add the bad example question text, the corresponding marked intent category and the intent category description marked for the marked intent category to the target prompt text, wherein the bad example question text is used as a question example of the marked intent category in the target prompt text.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor; a memory, wherein computer instructions are stored in the memory, and when the computer instructions are executed by the processor, the above method is implemented.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the above method is implemented.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, including computer instructions, which implement the above method when executed by a processor.

[0018] In the present application, a target prompt text is set specifically for the target business, and the target prompt text is used to guide the first language model to classify the question text in multiple candidate intent categories under the target business, and determine the first candidate intent category to which the question text belongs among the multiple candidate intent categories. Moreover, since the target prompt text includes the intent category description of each candidate intent category and the specific intent classification requirements under the target business, the intent category description for the candidate intent category in the target prompt text can assist the first language model in understanding each candidate intent category, and guide the first language model to classify the question text in accordance with the specific intent classification requirements under the target business, thereby ensuring that the first candidate intent category output by the first language model for the question text meets the specific intent classification requirements under the target business, and ensuring the accuracy of the first candidate intent category determined for the question text.

[0019] Moreover, the question text is also classified for intent through the intent classification model, and the intermediate intent classification result output by the intent classification model is used to determine the second candidate intent category to which the question text belongs among multiple candidate intent categories of the target business. Finally, the first candidate intent category and the second candidate intent category are combined to determine the target intent category of the question text under the target business. Compared with classifying the intent of the question text in one way, the scheme of the present application uses two intent classification methods to determine the first candidate intent category and the second candidate intent category, which can corroborate each other and improve the accuracy of the determined target intent category, thereby greatly improving the accuracy of intent classification.

[0020] These and other aspects of the present application will become more apparent from the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 It is a schematic diagram of an application scenario of the present application according to an embodiment of the present application.

[0023] Figure 2 It is a flowchart of an intent classification method according to an embodiment of the present application.

[0024] Figure 3 It is a flowchart of an intent classification method according to an embodiment of the present application.

[0025] Figure 4 It is a schematic diagram of an intent classification prompt text according to an embodiment of the present application.

[0026] Figure 5 is a flowchart of step 140 according to an embodiment of the present application.

[0027] Figure 6 is a flowchart of step 140 according to another embodiment of the present application.

[0028] Figure 7 It is a flowchart of constructing a question library corresponding to a target business according to an embodiment of the present application.

[0029] Figure 8 It is a schematic diagram of constructing a question library corresponding to a business according to an embodiment of the present application.

[0030] Fig. 9 It is a flowchart of an intent classification method according to an embodiment of the present application.

[0031] Fig.10 It is a schematic diagram of implementing the classification of intent according to an embodiment of the present application.

[0032] Fig.11 This is an application example diagram of the method of the present application shown in one embodiment of the present application.

[0033] Fig.12 It is a block diagram of an intent classification device shown in one embodiment of the present application.

[0034] Fig.13 It is a block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0035] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0036] In the following description, the terms "first\second" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0037] The "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the following description, it involves "some embodiments or some embodiments", which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0038] In the automatic question-answering scenario, after receiving the question text, it is necessary to first understand the semantics of the question text. An important process of semantic understanding is to identify the intent category of the question text, that is, to accurately classify the intent of the question text, and then accurately identify the semantics of the question text according to the intent category of the question text, and generate a reply text for the question text according to the semantics of the question text. The question text can be classified according to the method provided in this application to obtain the accurate intent category of the question text.

[0039] Figure 1 FIG. 1 is a schematic diagram of an application scenario according to an embodiment of the present application. Figure 1 As shown, the application scenario includes a terminal and a server 140. Figure 1 The first terminal 110 and the second terminal 120 are exemplarily shown. The first terminal 110 can run a client of application A, and the second terminal 120 can run a client of application B. Application A and application B are different applications.

[0040] The terminal is connected to the server 140 via the network 130, and the network 130 may be a wide area network or a local area network, or a combination of the two. In the present application, the server 140 may provide an automatic question-and-answer service for clients of multiple different applications. Since the functions of different applications are different, in the present application, the automatic question-and-answer service provided for one application may be regarded as an automatic question-and-answer service provided for one business, that is, one application may be regarded as one business.

[0041] In the process of providing automatic question-and-answer service, server 140 may receive question text and business identifier sent by the client, where the business identifier may be an application identifier of the application from which the question text originates. Afterwards, server 140 may classify the question text in accordance with the method provided in the present application, and determine the target intent category of the question text; then, perform semantic understanding of the question text according to the target intent category of the question text, and generate a reply text for the question text; thereafter, return the reply text to the client.

[0042] The process of server 140 determining the target intent category of the question text may be as follows: Figure 2 As shown, the server 140 can first classify the intent of the question text in two ways, namely, method 1: first, according to the target business identifier of the target business from which the question text comes (for example, it can be the application identifier of the application from which the question text comes), obtain the target prompt text associated with the target business identifier from the intention classification prompt text set, the target prompt text includes multiple candidate intent categories of the target business, intent category descriptions of each candidate intent category and specific intent classification requirements under the target business, then, input the target prompt text and the question text into the first largest language model, the first largest language model performs intent classification on the question text, and outputs the first candidate intent category to which the question text belongs among the multiple candidate intent categories of the target business.

[0043] Method 2: The server 140 also inputs the question text into the intent classification model, which performs intent classification on the question text and outputs an intermediate intent classification result; then, based on the intermediate intent classification result, the second candidate intent category to which the question text belongs among multiple candidate intent categories of the target business is determined.

[0044] Afterwards, the target intent category of the question text under the target business is determined based on the first candidate intent category to which the question text belongs among the multiple candidate intent categories of the target business and the second candidate intent category to which the question text belongs among the multiple candidate intent categories of the target business. Of course, in other embodiments, the server 140 may also use more methods to classify the intent of the question text, and then comprehensively determine the target intent category of the question text according to the classification results obtained by the above methods 1 and 2, as well as other intent classification methods.

[0045] In other embodiments, the method of the present application may also be executed by a terminal. In some embodiments, the terminal or server 140 may implement the intent classification method provided in the embodiment of the present application by running a computer program. For example, the computer program may be a native program or software module in the operating system; it may be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a question-and-answer application dedicated to providing automatic question-and-answer services; it may also be a small program, that is, a program that can be run only by downloading it to a browser environment; it may also be a small program or plug-in that can be embedded in any APP. In short, the above-mentioned computer program may be an application, module or plug-in in any form.

[0046] In some embodiments, the server 140 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal may be a smart phone, tablet computer, laptop computer, desktop computer, smart TV, smart watch, car terminal, smart speaker and other smart home devices, but is not limited thereto.

[0047] Figure 3 is a flow chart of an intent classification method according to an embodiment of the present application, and the intent classification method can be executed by an electronic device, such as the terminal, server, etc. mentioned above. Figure 3 As shown, the method includes the following steps 110 to 150, which are described in detail as follows:

[0048] Step 110: Obtain the question text and the target business identifier of the target business from which the question text originates.

[0049] The question text may be text indicating the question content input by the user in the user interface of the terminal, or may be text obtained by voice recognition of the user's question voice, which is not specifically limited here.

[0050] The target business refers to the business from which the currently pending question text originates. The target business identifier refers to the business identifier of the target business. In some embodiments, due to different application functions and application scenarios, different applications can be regarded as different applications. In this case, the target business can refer to the application from which the question text originates. In some embodiments, under the microservice architecture, different microservices are independently deployed and maintained, and different microservices are decoupled from each other and provide different functions. In this case, one microservice can be regarded as one business, and correspondingly, the target business can refer to the microservice from which the question text originates.

[0051] Step 120, obtaining a target prompt text associated with the target business identifier; the target prompt text includes a plurality of candidate intent categories of the target business, an intent category description of each candidate intent category, and specific intent classification requirements under the target business.

[0052] The target prompt text associated with the target business identifier can be obtained in the intent classification prompt text set of multiple businesses. The intent classification prompt text set includes intent classification prompt texts of multiple businesses, and the intent classification prompt text of each business can be associated with the business identifier of the business and stored in the intent classification prompt text set. The businesses involved in the intent classification prompt text set can be set according to actual needs. For the sake of ease of description, it is assumed that the intent classification prompt text set involves intent classification prompt texts of N businesses, N is a positive integer greater than 2, and N businesses are used in the following text to describe the multiple businesses here.

[0053] Among them, the intent classification prompt text of each business includes multiple intent categories of the business, intent category descriptions of each intent category, and specific intent classification requirements under the business. In this application, for the convenience of description, the intent classification prompt text associated with the target business identifier is referred to as the target prompt text. In other words, the target prompt text is the intent classification prompt text set for the target business. And, the intent category set for the target business is called a candidate intent category. In this application, the intent category represents the intention of asking a question, which is used to provide an accurate reply text to the question text later. The intent category can reflect the purpose or need of the user's question.

[0054] For a business, the multiple intent categories in the intent classification prompt text of the business are intent categories set for the business, that is, the multiple intent categories in the intent classification prompt text of the business limit the intent category range for the question text from the business. Different businesses have different functions or services, and the set intent category range (that is, the intent categories included in the intent classification prompt text of the business) is different.

[0055] The intent category description of an intent category refers to the text that describes or introduces the intent type, which may include the basic meaning of the intent category and the function of the intent category (i.e., which questions the intent category is mainly applicable to). For example, the intent category description for the intent category "Generate SQL" can be: Given a table and a question by the user, the relevant SQL can be generated; for another example, the intent category description for the intent category "Find Table" can be: It is used to find data table requirements, and can only return relevant table information; for another example, the intent category description for the intent category "Data Analysis" can be: It is suitable for more complex data analysis logic, and no conventional indicators are available, and relevant data analysis charts and reports can be returned.

[0056] In some embodiments, the intent classification prompt text may also include examples of questions for each intent type of the business. The question examples for the intent type may be examples of question texts belonging to the intent type, or may be features of question texts describing the intent type. It is understandable that the intent category descriptions and question examples for the intent categories in the intent classification prompt text are used to assist in understanding the corresponding intent categories.

[0057] In some embodiments, the intent category, intent category description of the intent category, and question examples of the intent category in the intent classification prompt text may be organized according to the following template: intent category / intent category description of the intent category / question examples of the intent category. Of course, in some embodiments, for some intent categories, the question examples of the intent category in the intent classification prompt text may also be empty.

[0058] The specific intent classification requirements under a business refer to the specific requirements or differentiated requirements that need to be followed in the process of intent classification of the question text of the business, that is, the intent classification requirements that are different from those of other businesses. The specific intent classification requirements for different businesses can be different. Of course, if a business does not have a specific intent classification requirement, the specific intent classification requirement item in the intent classification prompt text can also be empty.

[0059] In some embodiments, the intent classification prompt text of a service may also include a service introduction text of the service, for example, an introduction to the functions of the service and what aspects of the answers can be provided in the automatic question-and-answer process for the service. The intent classification prompt text also includes a command guide for indicating a command that needs to be executed by the first language model, and the command guide is used to instruct the first language model to perform intent classification on the input question text in a given plurality of intent categories.

[0060] Figure 4 It is a schematic diagram of an intent classification prompt text according to an embodiment of the present application. Figure 4 The intent classification prompt text in is for the XX platform business, such as Figure 4As shown, the content in the first dotted box 410 is the business introduction text of the XX platform; the content in the second dotted box 420 is a list of multiple intent categories for the XX platform, as well as intent category descriptions and question examples for each intent category. For example, for the intent category of "document Q&A", its intent category description is "XX product documentation, which can answer some product operation and other questions", and its question example is "most of the common questions asked by users contain XX", where XX is the name of the business. It is worth mentioning that Figure 4 Only some intent categories of the XX platform are shown as examples. In specific applications, the intent classification prompt text of a business will show all intent categories of the business, as well as relevant information of each intent category (such as intent category description and question examples).

[0061] The content in the third dotted box 430 is the specific intent classification requirements for the business. In this part, all intent categories involved in the business are listed first, as well as input and output examples in the intent classification process. Example question texts are listed for all intent categories under the business. The example question texts listed for each intent category can be one or more. Figure 4 , three example question texts for the intent category of “small talk” are shown as an example, that is, the texts of three input parts.

[0062] In addition, three personalized specific intent classification requirements that need to be paid attention to in this business are listed. The content selected by the fourth dotted box 440 is an input and output example of the first language model in the intent classification process, the input at least includes the question text input by the user, and the output is the intent category to which the question text belongs.

[0063] Of course, the content of the intent classification prompt text is not limited to Figure 4 As shown in , the intent classification prompt text can be customized according to the specific needs of the business, and the format followed by the intent classification prompt text can be: <instruction><example><specification><requirement>. The instruction part indicates the command that needs to be executed by the first language model (i.e., to classify the input question text into multiple given intent categories); the example part indicates the intent categories and question examples involved in the business; the specification part indicates the specific intent classification requirements under the business; the requirement part indicates the actual needs of the user, that is, the output needs to be specified based on the input.

[0064] In step 130, the first language model classifies the question text according to multiple candidate intent categories, the intent category descriptions of each candidate intent category, and the specific intent classification requirements under the target business, and determines the first candidate intent category to which the question text belongs among the multiple candidate intent categories.

[0065] The first language model refers to the large language model (LLM) that can classify the intent of question text. The large language model is an artificial intelligence model trained on a large amount of text data. It can understand and generate natural language text and can perform a wide range of tasks, such as intent classification tasks, text summarization, text translation, and summary generation.

[0066] The first candidate intent category refers to the intent category determined for the question text among multiple intent categories of the target business by performing intent classification on the input question text through the first language model. The first candidate intent category is one or more of the multiple intent categories of the business from which the question text comes. In some embodiments, if the intent classification prompt text of the business specifies that only one intent category is output for the input question text, for example Figure 4 If the specific intent classification requirement in the text limits the output of only one intent category, then the first candidate intent category is one; in some embodiments, if the intent classification prompt text of the business limits the output of the intent category for the input question text to exceed a first probability threshold, the first candidate intent category can be one or more.

[0067] Step 140 , the intention classification model performs intention classification on the question text, and determines a second candidate intention category to which the question text belongs from a plurality of candidate intention categories based on an intermediate intention classification result output by the intention classification model.

[0068] The second candidate intent category refers to the intent category determined for the question text by the intent classification model. Similarly, the second candidate intent category is one or more of the multiple candidate intent categories. It is worth mentioning that the first candidate intent category and the second candidate intent category determined for the question text are candidate intent categories determined for the same question text in two different ways. There may be the same candidate intent categories or different candidate intent categories in the two. The main difference is the different ways of intent classification.

[0069] The intent classification model refers to a neural network model specifically used to classify the intent of input text. It can be a model built by one or more neural networks, such as a recurrent neural network, a fully connected neural network, a convolutional neural network, etc., which are not specifically limited here.

[0070] In some embodiments, the intent classification model may be specifically applicable to the target business, that is, the intent classification model in step 140 is obtained by training using the question text set of the target business, the question text set of the target business includes sample question texts under the target business and labels of the sample question texts, and the labels of the sample question texts are used to indicate the intent category to which the sample question text belongs in multiple candidate intent categories under the target business. After the intent classification model is trained with the question text set of the target business, the intent classification model can learn the relationship between the question text under the target business and the multiple candidate intent categories under the target business, that is, it can learn the intent classification principle for the question text of the target business, and learn the multiple candidate intent categories set under the target business. In this case, the intent categories in the intermediate intent classification results are all located in the intent category set of the target business, and the intent category set of the target business is a collection of multiple candidate intent categories of the target business. The intermediate intent classification result may include the candidate intent category with the highest probability predicted by the intent classification model, and may also include one or more candidate intent categories with a probability exceeding the first probability threshold. Based on this, the candidate intent category in the intermediate intent classification result can be used as the second candidate intent category to which the question text belongs.

[0071] In some embodiments, an intent classification model can be pre-trained with a set of question texts for each business, so that the trained intent classification model is applicable to a business. Correspondingly, before step 140, the intent classification model corresponding to the target business is first determined according to the target business identifier, and then the intent classification model corresponding to the target business is called to execute step 140.

[0072] In some embodiments, the intent classification model may be applicable to N businesses, that is, the intent classification model is trained through a set of question texts of N businesses. In this case, the intent classification model actually performs intent classification in the candidate intent sets of N businesses for each input question text. As described above, the candidate intent set of a business is a set of multiple intent categories of the business, and the candidate intent set of N businesses is a set of N candidate intent sets. Therefore, the intermediate intent classification result output by the intent classification model for the current question text may contain intent categories that are not in the candidate intent set of the target business. Therefore, according to the candidate intent set of the target business, the candidate intent categories in the candidate intent set of the target business can be screened out from the intermediate intent classification results, and then the second candidate intent category to which the question text belongs in the multiple candidate intent categories (i.e., the candidate intent set of the target business) is determined in the screened candidate intent categories.

[0073] In some embodiments, when the intent classification model is applicable to N businesses, the intermediate intent classification result may include the probability that the question text belongs to each intent category in the candidate intent set of N businesses. Afterwards, the probability that the question text belongs to each candidate intent category in the candidate intent set of the target business can be obtained from the intermediate intent classification result, and based on the probability that the question text belongs to each candidate intent category in the candidate intent set of the target business, the candidate intent category with the highest probability is selected as the second candidate intent category, or one or more candidate intent categories with a probability exceeding the first probability threshold are selected as the second candidate intent category.

[0074] Step 150, determining a target intent category of the question text under the target business according to the first candidate intent category and the second candidate intent category.

[0075] In some embodiments, step 150 includes: voting on candidate intent categories in a candidate set, and determining a target intent category of the question text under a target business according to the voting result; the candidate set includes a first candidate intent category and a second candidate intent category.

[0076] For example, the number of occurrences of each candidate intent category in the candidate set can be counted, and the candidate intent category with the highest number of occurrences is used as the target intent category of the question text under the target business. In this case, the voting result can include the number of occurrences of each candidate intent category in the candidate set.

[0077] In some embodiments, a category classification model can be used to predict the scores of candidate intent categories in a candidate set based on the question text, and the scores of each candidate intent category in the candidate set can be output, wherein the score of the candidate intent category is positively correlated with the probability that the question text belongs to the candidate intent category. Thereafter, the candidate intent category with the highest score can be selected based on the scores of each candidate intent category in the candidate set as the target intent category of the question text under the target business. Alternatively, a candidate intent category with a score exceeding a first score threshold can be selected as the target intent category of the question text under the target business. In this embodiment, the input of the category classification model can be a text sequence obtained by combining the question text and all candidate intent categories in the candidate set, and thereafter, the category classification model can extract semantic features of the question text and each candidate intent category in the text sequence, and perform score prediction based on the extracted semantic features, and output the scores of each candidate intent category in the candidate set.

[0078] In some embodiments, the fourth largest language model can be used to determine the target intent category of the question text under the target business in the candidate set according to the first prompt. The first prompt may include the question text, all candidate intent categories in the candidate set, and a first command prompt, and the first command prompt is used to prompt the command that needs to be executed by the fourth largest language model. For example, the first command prompt can be used to prompt the fourth largest language model to determine whether there is an intent category to which a given question text belongs in a given number of intent categories (for example, all candidate intent categories in the candidate set), and if so, output the intent category to which the given question text belongs from the given number of intent categories. Correspondingly, the first prompt is used to guide the fourth largest language model to determine whether there is a candidate intent category to which the question text belongs in the candidate set, and when it is determined that there is a candidate intent category to which the question text belongs in the candidate set, output the candidate intent category to which the question text belongs as the target intent category. For example, if the candidate set includes three candidate intent categories, namely intent category A, intent category B and intent category C, and the question text is question text D, the first prompt may be: Please determine whether there is an intent category to which question text D belongs in intent category A, intent category B and intent category C, and if so, output the intent category to which question text D belongs from intent category A, intent category B and intent category C. Among them, the fourth language model and the first language model mentioned above may be the same language model or different language models, which is not specifically limited here.

[0079] In the present application, a target prompt text is set specifically for the target business, and the target prompt text is used to guide the first language model to classify the question text in multiple candidate intent categories under the target business, and determine the first candidate intent category to which the question text belongs among the multiple candidate intent categories. Moreover, since the target prompt text includes the intent category description of each candidate intent category and the specific intent classification requirements under the target business, the intent category description for the candidate intent category in the target prompt text can assist the first language model in understanding each candidate intent category, and guide the first language model to classify the question text in accordance with the specific intent classification requirements under the target business, thereby ensuring that the first candidate intent category output by the first language model for the question text meets the specific intent classification requirements under the target business, and ensuring the accuracy of the first candidate intent category determined for the question text.

[0080] Moreover, the question text is also classified for intent through the intent classification model, and the intermediate intent classification result output by the intent classification model is used to determine the second candidate intent category to which the question text belongs among multiple candidate intent categories of the target business. Finally, the first candidate intent category and the second candidate intent category are combined to determine the target intent category of the question text under the target business. Compared with classifying the intent of the question text in one way, the scheme of the present application uses two intent classification methods to determine the first candidate intent category and the second candidate intent category, which can corroborate each other and improve the accuracy of the determined target intent category, thereby greatly improving the accuracy of intent classification.

[0081] In some embodiments, after determining the target intent category of the question text under the target business, a reply text of the question text can be generated according to the target intent category of the question text under the target business. In some embodiments, if multiple reply generation services for replying to question texts under different intent categories are set in one business, the question text can be distributed to the reply generation service corresponding to the target intent category to which the question text belongs, and the corresponding reply generation service generates a reply text of the question text.

[0082] In some embodiments, the intent classification model is applicable to multiple services; Figure 5 As shown, step 140 includes the following steps 510 to 530:

[0083] Step 510, the intent classification model performs intent classification on the question text, and obtains an intermediate intent classification result output by the intent classification model for the question text in the candidate intent set of multiple businesses. The intermediate intent classification result includes the probability that the question text belongs to each intent category in the candidate intent set of multiple businesses.

[0084] The candidate intent set of multiple services includes multiple intent categories of each of the N services mentioned above, and the N services include the target service. As above, the intent classification model in this embodiment is obtained by training the question text set of the N services.

[0085] Step 520, obtaining the probability that the question text belongs to each candidate intent category under the target business in the intermediate intent classification result.

[0086] The candidate intent set of the target business can be obtained in advance, and the candidate intent set of the target business includes all candidate intent categories under the target business. According to the candidate intent set of the target business, the probability of each candidate intent category in the candidate intent set of the target business is obtained in the intermediate intent classification result. For example, if the intermediate intent classification result includes the probability that the question text belongs to 5 intent categories, the 5 intent categories are intent category I, intent category II, intent category III, intent category IV and intent category V, and the candidate intent set of the target business includes two intent categories, namely intent category I and intent category II, then the probability that the question text belongs to intent category I and the probability that it belongs to intent category II can be obtained in the intermediate intent classification result.

[0087] Step 530, determining a second candidate intent category to which the question text belongs from among multiple candidate intent categories under the target business according to the probability that the question text belongs to each candidate intent category under the target business.

[0088] In some embodiments, intent category screening rules are pre-set, and based on the probability that the question text belongs to each candidate intent category under the target business, the second candidate intent category is screened and determined from multiple candidate intent categories under the target business according to the intent category screening rules. For example, the intent category screening rule may be to screen the K candidate intent categories with the highest probability, where K is a positive integer, such as 1, 2, etc. For another example, the intent category screening rule may be to screen out candidate intent categories whose probabilities exceed a third probability threshold as the second candidate intent category. For another example, the intent category screening rule may be to screen out the M candidate intent categories with the highest probabilities from among the candidate intent categories whose probabilities exceed the third probability threshold, where M is a positive integer, such as 1, 2, etc.

[0089] In the above embodiment, it is equivalent to trusting the probability output by the intent classification model applicable to N businesses, and selecting a candidate intent category with a higher probability from multiple candidate intent categories under the target business based on the probability as the second candidate intent category to which the question text belongs. This method does not require training a classification model for each business separately, has a small amount of processing, and can ensure the efficiency of intent classification as a whole.

[0090] In some embodiments, step 530 includes: a target classification model trained for the target business performs probability prediction on each candidate intent category based on the probability that the question text belongs to each candidate intent category of the target business and the question text, to obtain a prediction result, wherein the prediction result is used to indicate the probability of each candidate intent category being the intent category to which the question text belongs; based on the prediction result, the candidate intent category with the highest probability of being the intent category to which the question text belongs is determined as the second candidate intent category.

[0091] In this embodiment, the target classification model trained for the target business is different from the intent classification model applicable to multiple businesses mentioned above. The target classification model trained for the target business can be obtained by training only using the question text set of the target business. In this case, a classification model can be trained for each business separately, and the classification model is used to predict the probability of each input intent category as the intent category to which the question text belongs based on the probability of the input intent category and the question text. In this way, according to the output of the target classification model, the output result can indicate the candidate intent category of the intent category to which the question text belongs as the second candidate intent category.

[0092] In some embodiments, the target classification model can directly reuse the features extracted by the intent classification model for the question text, that is, the features extracted by the intent classification model for the question text are input into the target classification model. In this way, the target classification model does not need to extract semantic features for the question text again, reducing the computational complexity of the target classification model. In the above embodiments, the parameter amount of the target classification model can be smaller than the above-mentioned intent classification model applicable to multiple businesses, that is, the scale of the target classification model is smaller than the scale of the above-mentioned intent classification model applicable to multiple businesses, and a large base classification model (that is, intent classification model) plus a small model (that is, target classification model) is adopted. In this way, the training time of the target classification model can be reduced. Moreover, the intent classification model applicable to multiple businesses and the target classification model applicable to the target business are used to comprehensively determine the second candidate intent category to which the question text belongs under the target business, and the probability output by the intent classification model is used as a reference, and the target classification model applicable to the target business is used to make targeted predictions based on the probability output by the intent classification model, which can improve the accuracy of the determined second candidate intent category.

[0093] In some other embodiments, the intent classification model includes a base model and multiple low-rank adaptive expert networks, and one low-rank adaptive expert network corresponds to one of the multiple services; Figure 6 As shown, step 140 includes the following steps 610 to 650:

[0094] Step 610: extract features from the question text using the base model to obtain a first text feature.

[0095] The base model is a large pre-trained model as a foundation, with a wide range of language understanding capabilities. The base model can extract semantic features from question texts from different businesses. In some embodiments, the Bert model can be used as the base model.

[0096] A low-rank adaptive expert network refers to an expert network suitable for a business that is trained by the low-rank adaptation (LoRA) method. Multiple expert networks are a mixture of experts (MoE). The low-rank adaptive expert network can be added after the pre-trained base model. The parameters of the low-rank adaptive expert network are introduced by low-rank decomposition of the pre-trained matrix. In this way, in the subsequent training process, by adjusting the parameters of the low-rank adaptive expert network without adjusting the parameters of the base model, the overall training efficiency of the base model and multiple low-rank adaptive expert networks can be improved, while maintaining the overall performance and knowledge retention of the model.

[0097] The base model and the low-rank adaptive expert network corresponding to a business are used to identify the intent of the question text from the business. The low-rank adaptive expert network corresponding to a business is trained by the question text set of the business. In the process of training the low-rank adaptive expert network corresponding to a business, the parameters of the base model remain unchanged, and the parameters of the low-rank adaptive expert network corresponding to the business are adjusted during the training process.

[0098] Taking business A as an example, the question text set of business A includes sample question texts from business A and intent categories annotated for sample question texts in multiple intent categories of business A. The training process of the low-rank adaptive expert network corresponding to business A is as follows: obtain the target sample question text and the intent category corresponding to the target sample question text from the question text set of business A; extract features of the target sample question text by the pre-trained base model to obtain the first sample text features; extract features of the target sample question text by the low-rank adaptive expert network corresponding to business A to obtain the second sample text features; weight the first sample text features and the second sample text features to obtain the target sample text features; perform intent classification according to the target sample text features to obtain the predicted intent category of the target sample question text; calculate the model loss according to the predicted intent category of the target sample question text and the intent category corresponding to the target sample question text; fix the parameters of the base model, and adjust the parameters of the low-rank adaptive expert network corresponding to business A until the training end condition is reached. The training process of other low-rank adaptive expert networks is similar.

[0099] Step 620, determine a low-rank adaptive expert network corresponding to the target service from among the multiple low-rank adaptive expert networks. In some embodiments, each low-rank adaptive expert network may be associated with a service identifier, whereby the low-rank adaptive expert network associated with the target service identifier may be determined as the low-rank adaptive expert network corresponding to the target service.

[0100] In some embodiments, a gated network can be set up, and the gated network determines the activation probability of each low-rank adaptive expert network based on the input service identifier. For example, the activation probability can be 0 or 1, and the low-rank adaptive expert network whose activation probability exceeds a preset threshold is determined as the low-rank adaptive expert network corresponding to the target service.

[0101] Step 630: The low-rank adaptive expert network corresponding to the target business extracts features from the question text to obtain a second text feature. The low-rank adaptive expert network corresponding to the target business can extract semantic features from the question text to obtain a second text feature.

[0102] Step 640, performing intent classification according to the weighted result of the first text feature and the second text feature to obtain an intermediate intent classification result, wherein the intermediate intent classification result indicates the second candidate intent category to which the question text belongs among the multiple candidate intent categories.

[0103] The intent classification layer can perform probability prediction on the weighted results of the first text feature and the second text feature to obtain the probability that the question text belongs to each of the multiple candidate intent categories under the target business, and add the candidate intent category with the highest probability to the intermediate intent classification result. Correspondingly, the candidate intent category with the highest probability is used as the second candidate intent category.

[0104] In the above embodiment, the intent classification tasks under multiple services are adapted and executed through the base model and multiple low-rank adaptive expert networks. Moreover, the intent classification tasks under multiple services share the base model, and only the corresponding low-rank adaptive expert network can be trained for each service. Fewer parameters need to be updated, which can shorten the training time. Moreover, when a new intent category is added to a service, only the low-rank adaptive expert network corresponding to the service can be updated and trained, without the need to retrain the entire intent classification model.

[0105] In some embodiments, the candidate set also includes a third candidate intent category to which the question text belongs among multiple candidate intent categories; the method also includes: retrieving candidate sample question texts that are semantically similar to the question text in a question library corresponding to the target business, the question library corresponding to the target business including multiple sample question texts stored in association with the candidate intent categories under the target business; determining the third candidate intent category to which the question text belongs among the multiple candidate intent categories based on the candidate intent category associated with the candidate sample question text.

[0106] In this application, the candidate intent category to which the question text belongs determined by searching the question library corresponding to the target business is called the third candidate intent category. Similarly, the third candidate intent category is also one or more of the multiple candidate intent categories of the target business.

[0107] Since the question library corresponding to the target business includes associated stored candidate intent categories and sample question texts, wherein a candidate intent category associated with a sample question text is regarded as the candidate intent category to which the sample question text belongs. The sample question text in the question library corresponding to the target business is related to the target business.

[0108] In some embodiments, semantic similarity may be calculated between sample question texts in the question library corresponding to the target business and the question text, and sample question texts in the question library corresponding to the target business whose semantic similarity with the question text exceeds a semantic similarity threshold may be used as candidate sample question texts.

[0109] In some embodiments, the semantic similarity between the sample question text and the question text can be obtained by calculating the Euclidean distance or cosine distance between the embedded representation of the sample question text and the embedded representation of the question text. In some embodiments, the candidate sample question texts semantically similar to the question text can be retrieved from the question library corresponding to the target business according to the BM25 (Best Matching 25) retrieval algorithm.

[0110] After the candidate sample question text is retrieved and determined, the candidate intent category associated with the candidate sample question text may be used as the third candidate intent category to which the question text belongs among the multiple candidate intent categories.

[0111] In the above embodiment, the intent classification results of the question text in multiple candidate intent categories under the target business can be determined in three different ways, namely the first candidate intent category, the second candidate intent category and the third candidate intent category, and then the target intent category of the question text under the target business can be determined according to the first candidate intent category, the second candidate intent category and the third candidate intent category determined for the question text in the three ways. The intent classification results obtained in the three different ways can support each other, and compared with determining the intent category to which the question text belongs in one way, the accuracy of intent classification can be greatly improved.

[0112] In some embodiments, the Figure 7 The process shown in the figure establishes a question library corresponding to the target business, such as Figure 7 As shown, including:

[0113] Step 710: Obtain a description text of the problem type for the target business.

[0114] The problem type description text may include the problem type and the description text of the problem type. The problem type description text for the target business may be manually written. The problem type description text may be used to describe a specific type of problem under the target business. That is to say, the problem type description text is an overview description of a small class of problems (i.e., problems belonging to a specific detailed type), and is not a specific problem text. Among them, the problem type described by the problem type description text may be a detailed type under the intent type, that is, the problem type may be a subclassification of the intent type, or it may be an intent type set for the target business. The problem type described by the problem type description text for the target business is related to the target business. For example, the description text for the problem type "data analysis" may be: suitable for more complex data analysis logic, no conventional indicators are available, and relevant data analysis charts and reports can be returned.

[0115] Step 720: The second largest language model generates a question based on the question generation prompt text and the question type description text to obtain a sample question text that conforms to the question type description text.

[0116] The question generation prompt text is used to prompt the second largest language model to generate a question that meets the question type description text. The second largest language model can be the same large language model as the first large language model mentioned above, of course, it can also be a different large language model.

[0117] Step 730 , using multiple different third language models to perform intent classification on the sample question text according to the intent classification prompt text and the question type description text, to obtain multiple intent classification results for the sample question text.

[0118] The intent classification prompt text is used to guide the question type description text and sample question text input by the third language model to perform intent classification on the sample question text. The third language model can output an intent classification result for the sample question text, and the intent classification result is used to indicate the intent category to which the sample question text belongs. In the above embodiment, the question type description text is input into the third language model along with the sample question text and the intent classification prompt text to assist the third language model in understanding the semantics of the sample question text to ensure the accuracy of the obtained intent classification result.

[0119] In some embodiments, the intent classification prompt text may further define optional intent categories to prompt the third language model to determine the intent category to which the sample question text belongs from the multiple intent categories defined by the intent classification prompt text. For example, if the question type description text is for a target business, the intent classification prompt text may define multiple candidate intent categories for the target business.

[0120] In some embodiments, the intent classification prompt text may further define intent classification principles to prompt the third language model to perform intent classification on the sample question text according to the intent classification principles defined by the intent classification prompt text. Among them, the intent classification principles defined by the intent classification prompt texts input by different third language models may be different. In this case, multiple intent classification results of the sample question text may reflect the intent categories of the sample question text under multiple different intent classification principles.

[0121] Step 740 , determining the target intent category to which the sample question text belongs from the multiple intent classification results of the sample question text.

[0122] In some embodiments, in step 740, the target intent category to which the sample question text belongs may be determined from among the multiple intent categories indicated by the multiple intent classification results of the sample question text in a similar implementation as in step 150 above. For example, the number of occurrences of each intent category in the multiple intent classification results may be counted, and then the intent category with the highest number of occurrences may be used as the target intent category to which the sample question text belongs.

[0123] For another example, the intent categories in multiple intent classification results of the sample question text and the sample question text can be input into a category classification model, and the category classification model outputs the scores of the intent categories in the multiple intent classification results of the sample question text, thereby determining the target intent category to which the sample question text belongs.

[0124] For another example, the intent categories in multiple intent classification results of the sample question text and the sample question text can be input into the fourth language model along with the first prompt, and the fourth language model determines the target intent category to which the sample question text belongs from the multiple intent classification results of the sample question text.

[0125] Step 750 , associate and store the sample question text and the target intent category to which the sample question text belongs in a question library corresponding to the target business.

[0126] Through the above method, it is realized to automatically build the question library corresponding to the target business by using the given question type description text. Of course, the question library for other businesses can be built in a similar way. Moreover, the above method does not require the online question text of the target business (that is, the question text sent by the actual user), and can be used to build the question library corresponding to the business in the cold start scenario.

[0127] In addition, the question text set of the target business can be determined based on the question library corresponding to the target business. For example, some or all of the sample question texts in the question library corresponding to the target business and the target intent categories associated with the sample question texts can be added to the question text set of the target business for training the intent classification model.

[0128] In some embodiments, after step 710, a sample question text that conforms to the question type description text can be manually written in advance based on the question type description text. In step 720, the question generation prompt text, the question type description text, and the sample question text can be input into the second largest language model, and the second largest language model diffuses the sample question text to generate a diffused question text that conforms to the question type description text. Afterwards, according to a process similar to steps 730-750, the diffused question text and the target intent category to which the diffused question text belongs are associated and stored in the question library corresponding to the target business. In this way, a question library corresponding to the target business can be automatically constructed by giving a question type description text and a portion of the sample question text for the question type description text.

[0129] In some embodiments, after step 720, the method further includes the following steps A1 to A4, which are described in detail as follows:

[0130] Step A1, rewrite the sample question text to obtain a rewritten question text.

[0131] In some embodiments, the rewriting guide can be used to guide the fifth language model to rewrite the sample question text and output the rewritten question text. The rewriting guide can be used to guide the fifth language model to rewrite the input sample question text to obtain a rewritten question text whose semantic similarity with the sample question text exceeds a first similarity threshold. As above, the fifth language model can be the same as or different from the first language model mentioned above.

[0132] In some embodiments, some of the segmented words in the sample question text may be replaced with synonyms or near synonyms of the segmented words to obtain a rewritten question text. Assuming that the language of the sample question text is a first language, in some embodiments, the sample question text in the first language may be translated into a second language to obtain a first translation result, and then the first translation result may be translated into the first language for a second time to obtain a rewritten question text, wherein the second language is different from the first language.

[0133] In some embodiments, entities in sample question text (such as names of people, places, company names, etc.) can be identified and then replaced with other similar or related entities. This approach can increase data diversity while keeping the subject and context of the text consistent.

[0134] In some implementations, the sample question text may be perturbed by a text processing model (e.g., a large language model) to obtain a rewritten question text, wherein the perturbation may be performed by deleting or replacing some words in the sample question text, or by adding words to the sample question text. In some embodiments, perturbations may be added to the embedding lower layer of the text processing model to increase the robustness of the model, or adversarial training methods (e.g., fast gradient methods) may be used to add perturbations in the direction of the rising loss function.

[0135] In some embodiments, the words in the sample question text may be rearranged to obtain a rewritten question text. Of course, the main themes of the rewritten question text and the sample question text may be constrained to remain unchanged.

[0136] Of course, in a specific embodiment, the same sample question text may be rewritten in a variety of different ways to obtain a plurality of rewritten question texts to enrich the text data.

[0137] Step A2, using multiple different third language models to perform intent classification on the rewritten question text according to the corresponding intent classification prompt text and question type description text, to obtain multiple intent classification results of the rewritten question text.

[0138] Step A3, determining the target intent category to which the rewritten question text belongs from the multiple intent classification results of the rewritten question text.

[0139] Step A4: associate and store the rewritten question text and the target intent category to which the rewritten question text belongs in a question library corresponding to the target business.

[0140] The process of step A2 to step A4 is basically the same as the specific implementation process of step 730 to step 750 above, and will not be repeated here.

[0141] In the above embodiment, by rewriting the sample question text to obtain the rewritten question text, a richer question text can be obtained, thereby enriching the data in the question library corresponding to the target business. In this way, a small amount of sample question text can be used to obtain a large amount of question text. Especially in the cold start scenario, the question library corresponding to the business can be quickly constructed to facilitate the subsequent intent classification according to the question library corresponding to the business.

[0142] In some embodiments, the target prompt text also includes question examples for each candidate intent category; the method also includes the following steps B1 to B4:

[0143] Step B1, obtaining a newly added intent category for the target business and a second question type description text annotated for the newly added intent category.

[0144] In actual applications, during the operation of a business, there may be a situation where a new intent category is added to the business. In this application, the newly added intent category is referred to as a newly added intent category. The question type description text manually annotated for the newly added intent category is referred to as a second question type description text. If the newly added intent category involves multiple refined question types, there may be multiple second question type description texts annotated for the newly added intent category, and one second question type description text is used to describe a question type under the newly added intent category.

[0145] Step B2: The second largest language model generates a question based on the question generation prompt text and the newly added question type description text to obtain a second sample question text that conforms to the newly added question type description text.

[0146] Step B3: associate the second sample question text and the newly added intent category and store them in the question library corresponding to the target business.

[0147] The second sample question text refers to the generated question text that conforms to the description text of the newly added question type. After the second sample question text and the newly added intent category are associated and stored in the question library corresponding to the target business, if the question text sent by the user is subsequently associated with the second sample question text with the newly added intent category, the newly added intent category can be used as the intent classification result of the question text.

[0148] Step B4, adding the second sample question text, the newly added intent category and the intent category description annotated for the newly added intent category to the target prompt text, wherein the second sample question text in the target prompt text serves as a question example of the newly added intent category.

[0149] Since the second sample question text, the newly added intent category and the intent category description annotated for the newly added intent category are added to the target prompt text, for subsequent question texts, the first largest language model can accurately classify intents in the intent categories limited to the target prompt text. Moreover, the second sample question text and the intent category description annotated for the newly added intent category added to the target prompt text can assist the first largest language model in understanding the newly added intent category.

[0150] In the above embodiment, for the newly added intent category, the second sample question text generated for the newly added intent category is stored in the question library corresponding to the target business along with the newly added intent category, and the second sample question text, the newly added intent category and the intent category description marked for the newly added intent category are added to the target prompt text. In this way, the subsequent question text related to the newly added intent category (i.e., the question text whose actual intent category is the newly added intent category) can be accurately classified for intent by searching the question library corresponding to the target business and by the first language model classifying intent under the guidance of the target prompt text. Compared with the method of only using the intent classification model for intent classification in the related art, in the case of a new intent category, the intent classification model needs to be updated and trained again in order to accurately classify the question text related to the newly added intent category, and the update training needs to be completed before it can be put online for use.

[0151] However, by adopting the method of the present application, since the final intent classification result is determined comprehensively by combining the intent classification results obtained by the three intent classification methods, in the case of a new intent category, even if the training intent classification model is not updated, the accuracy of the final determined intent category can be guaranteed by searching the question library corresponding to the target business and by the first language model classifying the intent under the guidance of the target prompt text. In this way, it is ensured that even when a new intent category is added, it can be quickly applied online, with high scalability and fast online deployment. When a new intent category is added, the new intent category can be quickly and automatically connected to the online according to the above embodiment.

[0152] In some embodiments, the target prompt text further includes question examples for each candidate intent category; the method further includes:

[0153] Step C1, obtaining bad example problem text from the target business.

[0154] A bad example question text may be a question text to which the user's feedback reply is inaccurate. It is understandable that in a question-answering scenario, if the reply text is inaccurate, the possible reason is a misunderstanding of the question text, and the possible reason is that the intent category determined for the question text is wrong. Therefore, a question text to which the user's feedback reply is inaccurate can be regarded as a bad example question text.

[0155] Step C2, obtaining the labeling intention category for labeling the bad example question text and the intention category description for labeling the labeling intention category.

[0156] The labeled intent category refers to the intent category labeled for the bad case question text. The bad case question text may be labeled with the intent category manually to obtain the labeled intent category of the bad case question text. The labeled intent category is regarded as the intent category to which the bad case question text actually belongs. Similarly, the labeled intent category of the bad case question text is one of multiple candidate intent categories of the target business. Similarly, the intent category description of the labeled intent category may also be manually written.

[0157] Step C3: associate the bad example question text and the corresponding annotation intention category and store them in the question library corresponding to the target business.

[0158] Step C4, adding the bad example question text, the corresponding marked intent category and the intent category description marked for the marked intent category to the target prompt text, wherein the bad example question text is used as a question example of the marked intent category in the target prompt text.

[0159] In the above embodiment, for bad example question texts, the bad example question texts and the corresponding annotated intent classifications are associated and stored in the question library corresponding to the target business, and the bad example question texts, the corresponding annotated intent classifications and the intent category descriptions annotated for the annotated intent classifications are added to the target prompt text, so that if a question text with highly similar semantics to the bad example question text is encountered later, the question text can be accurately classified for intent by searching in the question library corresponding to the target business and by the first language model performing intent classification under the guidance of the target prompt text. Compared with the related art, which only uses the intent classification model for intent classification, when encountering bad example question texts, the intent classification model needs to be updated and trained again to accurately classify the intent of question texts similar to the bad example question texts.

[0160] However, the method of the present application combines the intent classification results obtained by the three intent classification methods to comprehensively determine the final intent classification result. In the case of a new intent category, even if the training intent classification model is not updated, the intent classification result obtained by searching the question library corresponding to the target business and the first language model classifying the intent under the guidance of the target prompt text is more accurate, thereby ensuring the accuracy of the final determined intent category. In this way, it is ensured that even in the case of bad example question texts, it can be quickly applied online, and the accuracy of online intent classification can be guaranteed in the short term. Of course, in the long term, the training intent classification model can be updated according to a preset period to ensure the accuracy of intent classification performed by the intent classification model.

[0161] The solution of the present application is described in detail below in conjunction with a specific embodiment.

[0162] Figure 8 FIG. 1 is a schematic diagram of constructing a question library corresponding to a business according to an embodiment of the present application. Figure 8 As shown, the sample question text can be generated and the target intent category to which the sample question text belongs can be determined as follows:

[0163] Method 1): (1) Obtain a question type description text for the business from the first database; of course, you can also manually write a question text that conforms to the question type description text; (2) Question generation: Generate questions based on the question type description text using the second language model to obtain sample question text that conforms to the question type description text; (3) Intent classification: Use multiple different third language models (such as Figure 8 LLM 1, LLM 2, ..., LLM X in are multiple different third-largest language models) according to the intent classification prompt text (e.g. Figure 8 Prompt 1, prompt 2, ..., prompt X) shown as an example in the figure perform intent classification on the sample question text to obtain multiple intent classification results of the sample question text; in this case, the input of the third language model includes the intent classification prompt text, the question type description text and the sample question text. (4) Intent category decision: Perform intent category decision on the multiple intent classification results of the sample question text to determine the target intent category to which the sample question text belongs. (5) The sample question text and the target intent category to which it belongs are associated and stored in the question library corresponding to the business. For the specific implementation process of the above processes (1)-(5), please refer to the above. Figure 7 The implementation details of each step in the corresponding embodiment.

[0164] Method 2): Perform data enhancement to obtain enhanced question text. Then, determine the target intent category to which the enhanced question text belongs according to the intent classification and intent category decision process in Method 1, and associate the enhanced question text with the target intent category to which it belongs and store it in the question library corresponding to the business.

[0165] Figure 8 Five data enhancement methods are shown in Figure 1, which are:

[0166] ①LLM rewriting enhancement: The fifth language model is guided by the rewriting guide to rewrite the reference sample question text to obtain the rewritten question text; the reference sample question text can be a question text written in advance by humans, or it can be a sample question text generated by question generation based on the question type description text.

[0167] ② Synonym enhancement: Replace the words in the reference sample question text with corresponding synonyms or near synonyms.

[0168] ③ Bidirectional translation enhancement: The reference sample question text is now translated from the current first language into the expression in the second language, and then the expression in the second language of the reference sample question text is retranslated into the expression in the first language, and the expression in the first language obtained after two translations is used as the enhanced question text.

[0169] ④ Manual annotation: The question text is manually written, or the existing sample question text is manually rewritten. Of course, the enhanced question text obtained through manual annotation can be further enhanced by other data enhancement methods to obtain more and richer enhanced question texts.

[0170] In the initial cold start phase, you can follow Figure 8 The process shown constructs a question library corresponding to each business through the existing data in the first database (i.e., question type-question type description text) and the data enhancement methods ①-④ above. The question library of the business can be automatically constructed by the above method; in the case of a new business, it is only necessary to give a preset number of question type description texts to the new business, and then generate a large number of data samples (sample question text + intent category) by the above method. In addition, in the case of a new intent category for a business, the sample question text corresponding to the newly added intent category in the question library can also be enriched in a similar manner as described above.

[0171] After providing services to online users, data enhancement can also be performed in the fifth way as follows.

[0172] ⑤ Business data prediction: refers to obtaining business log data from the business online. On the one hand, the historical question texts submitted by users online are obtained from the business log data, and then the intent classification and intent category decision are performed according to the above-mentioned intent classification method. On the other hand, for the historical question texts in the business log data, the historical question texts can be classified by intent through a classification model (that is, an intent classification model specially trained for the current business), and then some historical question texts and predicted intent categories are selected according to a preset selection strategy (for example, the intent categories and historical question texts with predicted probabilities higher than the set fourth probability threshold are selected), and the associated storage is stored in the question library corresponding to the business.

[0173] Fig. 9 This is a flowchart of intent classification according to an embodiment of the present application, taking the intent classification of question texts from the target business as an example, which specifically includes three steps, namely 1)-3) as follows:

[0174] Determine the candidate intent categories; specifically, obtain the intent candidate set of the target business, which includes all the candidate intent categories under the target business. And obtain the target prompt text of the target business, Fig. 9In the intent configuration table of the service, the target prompt text of the target service can be indicated.

[0175] Intent classification: In this embodiment, three different methods are used to classify the intent of the question text: based on the intent classification model, based on the retrieval method, and based on the first language model + target prompt text. The method of using the first language model + target prompt text to classify the intent is to classify according to the process of step 330 above; the intent classification is based on the intent classification model, that is, the classification is performed according to the process of step 340 above; based on the retrieval method, that is, the process of searching the question text in the question library corresponding to the target business to determine the third candidate intent category to which the question text belongs.

[0176] Intent category voting. This means voting on the results obtained by the above three intent classification methods and determining the target intent category to which the question text belongs. For the specific voting method, please refer to the description above.

[0177] Above Fig. 9 The specific process of intent classification can be as follows: Fig.10 As shown, first: the question text and the target prompt text of the target business are input into the first language model, and the first language model outputs the first candidate intent category for the question text among multiple candidate intent categories of the target business. Among them, the target prompt text of the target business is a prompt specially customized for the target business, which can meet the differentiated needs of intent classification of the target business. This method can take into account the generalization and timely expansibility of the problem. For example, if a bad case question text appears, or a new intent category appears, the bad case question text and the information related to the new intent category can be updated to the target prompt text in time to guide the first language model to accurately classify the intent.

[0178] Second: Based on the question banks built for multiple businesses (the question banks include sample question texts associated with each intent category under the corresponding business, Fig.10 In the figure, multiple intent categories under application 1 are exemplified: small talk, document question and answer, indicator calculation, data analysis, etc.), and in the question libraries corresponding to multiple businesses, the question library corresponding to the target business is determined. Then, sample question texts with high semantic similarity to the question text are retrieved in the question library corresponding to the target business, and based on the intent category associated with the sample question text, the third candidate intent category to which the question text belongs is determined. This method can also take into account the generalization and timely expansibility of the problem. For example, if a bad example question text appears, or a new intent category appears, the bad example question text and the information related to the new intent category can be updated to the corresponding question library in a timely manner as the data basis for retrieval.

[0179] Third: classify the question text by the intent classification model, and determine the second candidate intent category to which the question text belongs from multiple candidate intent categories of the target business according to the intermediate intent classification result output by the intent classification model. As described above, there are three implementation methods for determining the second candidate intent category by the intent classification model:

[0180] Implementation method A: An intent classification model can be trained separately for each business. In this case, the intent classification model corresponding to the target business can adapt to the intent classification needs of the target business. Correspondingly, the intent classification of the question text is performed using the intent classification model corresponding to the target business, and the candidate intent category with the highest probability of the intermediate intent classification result can be used as the second candidate intent category to which the question text belongs. The deployment cost of the intent classification model in this way is relatively high.

[0181] Embodiment method B: The above-mentioned intent classification model is applicable to multiple businesses. In this case, the intent categories involved in the intermediate intent classification results may include intent categories under other businesses except the target business. Therefore, in this case, the probability of the candidate intent categories under the target business is first screened out from the intermediate intent classification results, and then it can be processed in any of the following two ways: Method 1) After the probability of the candidate intent categories under the target business is screened out, the second candidate intent category is screened and determined from the multiple candidate intent categories under the target business according to the intent category screening rules. Method 2): The target classification model trained for the target business is reclassified, and then the second candidate intent category is determined based on the prediction results obtained by the reclassification. Method 2) is equivalent to training an intent classification model applicable to multiple intent categories under multiple businesses, and training a smaller target classification model for each business to adapt to the differentiated needs of each business.

[0182] The two methods in the above-mentioned implementation mode B can be collectively referred to as: broad classification + business filtering classification + reordering strategy, broad classification refers to classification under multiple intent categories under multiple businesses through an intent classification model applicable to multiple businesses; business filtering classification refers to screening out the probability of the intent category under the business from which the current question text comes from from the intermediate intent classification results; reordering refers to further screening and determining the second candidate intent category based on the probability of the intent category under the business from which the current question text comes.

[0183] Embodiment C: Use a base model + low-rank adaptive expert networks corresponding to multiple services to perform multi-task learning; during the training process, only the corresponding low-rank adaptive expert network can be trained for each service.

[0184] In the above embodiment of implementing intent classification, for the online bad example question text, the information related to the bad example question text can be quickly stored in the question library of the corresponding business and added to the intent classification prompt text corresponding to the business, so as to ensure the accuracy of online classification in the short term and realize timely repair of bad examples; in the long term, the intent classification model can be regularly updated to ensure the accuracy of the model side. Since this scheme adopts three different methods for intent classification, compared with adopting one method for intent classification, the results obtained by multiple methods can corroborate each other, ensuring the accuracy of the target intent category determined for the question text. Moreover, when adding a new business, the question library of the new business can be constructed in the case of cold start, and when the intent classification prompt text is set for the new business, it can be ensured that the intent classification of the question text from the new business can be accurately carried out through the first language model and the retrieval method, which has good scalability, can ensure the efficient access of the new business, and can also efficiently access the new intent category under a business.

[0185] Through implementation, it is found that the accuracy of intent classification using only one method is only 60%, while in the above embodiment, three methods are used for intent classification, and a comprehensive decision is made based on the intent classification results obtained by the three methods to determine the final intent category, with an accuracy rate of more than 95%. It can be seen that the solution of this application can greatly improve the accuracy of intent classification. Moreover, the solution of this application can facilitate the access of new services and new intent types, and has high scalability.

[0186] Fig.11 This is an application scenario of the method of the present application shown in an embodiment of the present application, such as Fig.11 As shown, the method of the present application can be applied to question-answering task recognition scenarios and intent clarification scenarios. In the question-answering task recognition scenario, the intent categories can be normalized first, that is, the intent categories with different expressions but the same essence are unified into the same expression; after receiving the question text, the text is multi-path recognized, that is, the question text is classified by intent in multiple ways, for example, the intent classification can be performed according to the three methods provided in this application, and then the multiple intent classification results of the question text are voted to determine the intent category to which the question text belongs under the corresponding business. After identifying the intent category, the question text can be sent to the question-answering module responsible for answering questions related to the intent type, so that the corresponding question-answering model can generate a reply to the question text. In this way, it is equivalent to realizing the distribution of the question text by classifying the intent of the question text. Identifying the intent category to which the question text belongs is equivalent to identifying the question-answering task to which the current question text belongs.

[0187] In the intent clarification scenario, the question text can be first classified into intent categories. In this process, the method of the present application can be used to classify intent. After that, pre-disassembly is performed according to the determined intent categories, and key information in the question text is identified according to the identified intent categories. If it is determined that key information is missing in the question text, the intent clarification content can be returned.

[0188] The following describes an apparatus embodiment of the present application, which can be used to execute the method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned method embodiment of the present application.

[0189] Fig.12 is a block diagram of an intent classification device according to an embodiment of the present application, such as Fig.12 As shown, the intent classification device includes: a first acquisition module 1210, which is used to obtain the question text and the target business identifier of the target business from which the question text comes; a second acquisition module 1220, which is used to obtain the target prompt text associated with the target business identifier; the target prompt text includes multiple candidate intent categories of the target business, the intent category description of each candidate intent category and the specific intent classification requirements under the target business; the first classification module 1230 is used to perform intent classification on the question text according to the multiple candidate intent categories, the intent category description of each candidate intent category and the specific intent classification requirements under the target business by the first large language model, and determine the first candidate intent category to which the question text belongs among the multiple candidate intent categories; the second classification module 1240 is used to perform intent classification on the question text by the intent classification model, and determine the second candidate intent category to which the question text belongs among the multiple candidate intent categories according to the intermediate intent classification result output by the intent classification model; the intent category determination module 1250 is used to determine the target intent category of the question text under the target business according to the first candidate intent category and the second candidate intent category.

[0190] In some embodiments, the intent classification model is applicable to multiple businesses; the second classification module 1240 includes: a first classification unit, which is used to perform intent classification on the question text by the intent classification model, and obtain an intermediate intent classification result output by the intent classification model for the question text in the candidate intent set of multiple businesses, and the intermediate intent classification result includes the probability that the question text belongs to each intent category in the candidate intent set of multiple businesses; a first probability determination unit, which is used to obtain the probability that the question text belongs to each candidate intent category under the target business in the intermediate intent classification result; a second candidate intent category determination unit, which is used to determine the second candidate intent category to which the question text belongs among the multiple candidate intent categories under the target business according to the probability that the question text belongs to each candidate intent category under the target business.

[0191] In some embodiments, the second candidate intent category determination unit is further used to: use a target classification model trained for the target business to perform probability prediction on each candidate intent category based on the probability that the question text belongs to each candidate intent category of the target business and the question text, to obtain a prediction result, wherein the prediction result is used to indicate the probability of each candidate intent category being the intent category to which the question text belongs; based on the prediction result, the candidate intent category with the highest probability of being the intent category to which the question text belongs is determined as the second candidate intent category.

[0192] In some embodiments, the intent classification model includes a base model and multiple low-rank adaptive expert networks, and one low-rank adaptive expert network corresponds to one of multiple businesses; the second classification module 1240 includes: a first feature extraction unit, which is used to extract features from the question text by the base model to obtain a first text feature; an activation information output unit, which is used to output activation information by the gating network according to the question text and the target business identifier, and the activation information is used to indicate the activation probability of each low-rank adaptive expert network; an expert network determination unit, which is used to determine the low-rank adaptive expert network corresponding to the target business among multiple low-rank adaptive expert networks; a second feature extraction unit, which is used to extract features from the question text by the low-rank adaptive expert network corresponding to the target business to obtain a second text feature; an intermediate intent classification result output unit, which is used to perform intent classification according to the weighted result of the first text feature and the second text feature to obtain an intermediate intent classification result, and the intermediate intent classification result indicates the second candidate intent category to which the question text belongs among multiple candidate intent categories.

[0193] In some embodiments, the intent category determination module 1250 is further used to: vote on the candidate intent categories in the candidate set, and determine the target intent category of the question text under the target business based on the voting results; the candidate set includes a first candidate intent category and a second candidate intent category.

[0194] In some embodiments, the candidate set also includes a third candidate intent category to which the question text belongs among multiple candidate intent categories; the intent classification device also includes: a retrieval module, used to retrieve candidate sample question texts that are semantically similar to the question text in a question library corresponding to the target business, the question library corresponding to the target business including multiple sample question texts stored in association with the candidate intent categories under the target business; a third candidate intent category determination module, used to determine the third candidate intent category to which the question text belongs among multiple candidate intent categories based on the candidate intent category associated with the candidate sample question text.

[0195] In some embodiments, the intent classification device also includes: a third acquisition module, used to obtain a question type description text for a target business; a first question generation module, used to generate a question according to a question generation prompt text and a question type description text by a second language model, and obtain a sample question text that conforms to the question type description text; a fourth classification module, used to perform intent classification on the sample question text according to intent classification prompt texts and question type description texts through multiple different third language models, and obtain multiple intent classification results for the sample question text; a second intent category determination module, used to determine the target intent category to which the sample question text belongs from the multiple intent classification results of the sample question text; and a first association storage module, used to associate and store the sample question text and the target intent category to which the sample question text belongs in a question library corresponding to the target business.

[0196] In some embodiments, the intent classification device also includes: a rewriting module, which is used to rewrite the sample question text to obtain a rewritten question text; a fifth classification module, which is used to perform intent classification on the rewritten question text according to the corresponding intent classification prompt text and the question type description text through multiple different third language models, and obtain multiple intent classification results of the rewritten question text; a third intent category determination module, which is used to determine the target intent category to which the rewritten question text belongs from the multiple intent classification results of the rewritten question text; and a second association storage module, which is used to associate and store the rewritten question text and the target intent category to which the rewritten question text belongs in a question library corresponding to the target business.

[0197] In some embodiments, the target prompt text also includes question examples for each candidate intent category; the intent classification device also includes: a fourth acquisition module, used to obtain a new intent category for the target business, and a second question type description text annotated for the new intent category; a second question generation module, used to generate questions based on the question generation prompt text and the new question type description text by the second largest language model, to obtain a second sample question text that conforms to the new question type description text; a third associated storage module, used to associate and store the second sample question text and the new intent category in a question library corresponding to the target business; a first adding module, used to add the second sample question text, the new intent category and the intent category description annotated for the new intent category to the target prompt text, wherein the second sample question text is used as a question example of the new intent category in the target prompt text.

[0198] In some embodiments, the target prompt text also includes question examples for each candidate intent category; the intent classification device also includes: a fifth acquisition module, used to obtain bad example question text from the target business; a sixth acquisition module, used to obtain the marked intent category marked for the bad example question text, and the intent category description marked for the marked intent category; a fourth associated storage module, used to associate the bad example question text and the corresponding marked intent category and store them in the question library corresponding to the target business; a second adding module, used to add the bad example question text, the corresponding marked intent category and the intent category description marked for the marked intent category to the target prompt text, wherein the bad example question text is used as a question example of the marked intent category in the target prompt text.

[0199] Fig.13 The schematic diagram of the structure of a computer system of an electronic device suitable for implementing the embodiment of the present application is shown. The electronic device may be a terminal or a server as described above, and is used to implement the intent classification method provided by the present application. It should be noted that: Fig.13 The computer system 1300 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0200] like Fig.13 As shown, the computer system 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1302 or the program loaded from the storage part 1308 to the random access memory (RAM) 1303, such as executing the method in the above embodiment. In RAM 1303, various programs and data required for system operation are also stored. CPU 1301, ROM 1302 and RAM 1303 are connected to each other through bus 1304. Input / output (I / O) interface 1305 is also connected to bus 1304.

[0201] The following components are connected to the I / O interface 1305: an input section 1306 including a keyboard, a mouse, a microphone, etc.; an output section 1307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 13013 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 13013 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed so that the computer instructions read therefrom are installed into the storage section 1308 as needed.

[0202] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes computer instructions. When the computer instructions are executed by the central processing unit (CPU) 1301, various functions defined in the system of the present application are executed.

[0203] The present application also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the method in any of the above method embodiments is implemented.

[0204] It should be noted that the computer-readable storage medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0205] In the embodiments of the present application, the term "module" or "unit" refers to a computer instruction or a part of a computer instruction with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit of the module or unit function.

[0206] The above are only preferred embodiments of the present application, and are not intended to limit the present application in any form. Although the present application has been disclosed as above with preferred embodiments, it is not intended to limit the present application. Any technical personnel in the field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present application. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.

Claims

1. An intent classification method, characterized in that: include: Obtaining a question text and a target business identifier of a target business from which the question text originates; Obtaining a target prompt text associated with the target service identifier; The target prompt text includes a plurality of candidate intent categories of the target business, an intent category description of each candidate intent category, and a specific intent classification requirement under the target business; The first language model performs intent classification on the question text according to the multiple candidate intent categories, the intent category descriptions of the candidate intent categories, and the specific intent classification requirements under the target business, and determines a first candidate intent category to which the question text belongs among the multiple candidate intent categories; The intention classification model performs intention classification on the question text, and determines a second candidate intention category to which the question text belongs from among the multiple candidate intention categories according to an intermediate intention classification result output by the intention classification model; A target intent category of the question text under the target business is determined according to the first candidate intent category and the second candidate intent category.

2. The method according to claim 1, characterized in that The intent classification model is applicable to the multiple businesses; The step of performing intent classification on the question text by the intent classification model, and determining a second candidate intent category to which the question text belongs from among the multiple candidate intent categories according to the intermediate intent classification result output by the intent classification model, includes: The intention classification model performs intent classification on the question text to obtain an intermediate intent classification result output by the intention classification model for the question text in the candidate intent set of the multiple businesses, wherein the intermediate intent classification result includes the probability that the question text belongs to each intent category in the candidate intent set of the multiple businesses; Obtaining the probability that the question text belongs to each candidate intent category under the target business in the intermediate intent classification result; According to the probability that the question text belongs to each candidate intent category under the target business, a second candidate intent category to which the question text belongs is determined from multiple candidate intent categories under the target business.

3. The method according to claim 2, characterized in that The determining, according to the probability that the question text belongs to each candidate intent category under the target business, a second candidate intent category to which the question text belongs from a plurality of candidate intent categories under the target business comprises: The target classification model trained for the target business performs probability prediction on each candidate intent category of the target business based on the probability that the question text belongs to each candidate intent category and the question text, to obtain a prediction result, wherein the prediction result is used to indicate the probability that each candidate intent category is the intent category to which the question text belongs; According to the prediction result, the candidate intent category with the highest probability of being the intent category to which the question text belongs is determined as the second candidate intent category.

4. The method according to claim 1, characterized in that The intent classification model includes a base model and multiple low-rank adaptive expert networks, one low-rank adaptive expert network corresponding to one of the multiple services; The step of performing intent classification on the question text by the intent classification model, and determining a second candidate intent category to which the question text belongs from among the multiple candidate intent categories according to the intermediate intent classification result output by the intent classification model, includes: The base model performs feature extraction on the question text to obtain a first text feature; Determining, among the multiple low-rank adaptive expert networks, a low-rank adaptive expert network corresponding to the target service; Using a low-rank adaptive expert network corresponding to the target business, extracting features from the question text to obtain a second text feature; Intent classification is performed according to a weighted result of the first text feature and the second text feature to obtain the intermediate intent classification result, wherein the intermediate intent classification result indicates the second candidate intent category to which the question text belongs among the multiple candidate intent categories.

5. The method according to any one of claims 1 to 4, characterized in that The determining, according to the first candidate intent category and the second candidate intent category, a target intent category of the question text under the target business includes: Voting is performed on candidate intent categories in a candidate set, and a target intent category of the question text under the target business is determined according to the voting result; the candidate set includes the first candidate intent category and the second candidate intent category.

6. The method according to claim 5, characterized in that The candidate set also includes a third candidate intent category to which the question text belongs among the multiple candidate intent categories; the method further includes: Retrieving candidate sample question texts that are semantically similar to the question text in a question library corresponding to the target business, wherein the question library corresponding to the target business includes a plurality of sample question texts stored in association with candidate intent categories under the target business; According to the candidate intent categories associated with the candidate sample question text, a third candidate intent category to which the question text belongs among the multiple candidate intent categories is determined.

7. The method according to claim 6, characterized in that The method further comprises: Obtain a description text of the problem type for the target business; The second language model generates a question based on the question generation prompt text and the question type description text to obtain a sample question text that conforms to the question type description text; Using a plurality of different third language models, the sample question text is subjected to intent classification according to the intent classification prompt text and the question type description text, to obtain a plurality of intent classification results for the sample question text; Determining a target intent category to which the sample question text belongs among a plurality of intent classification results of the sample question text; The sample question text and the target intent category to which the sample question text belongs are associated and stored in a question library corresponding to the target business.

8. The method according to claim 7, characterized in that After the second language model generates a question based on the question generation prompt text and the question type description text to obtain a sample question text that conforms to the question type description text, the method further includes: Rewriting the sample question text to obtain a rewritten question text; Using a plurality of different third language models, the rewritten question text is subjected to intent classification according to the corresponding intent classification prompt text and the question type description text, to obtain a plurality of intent classification results for the rewritten question text; Determining a target intent category to which the rewritten question text belongs among a plurality of intent classification results of the rewritten question text; The rewritten question text and the target intent category to which the rewritten question text belongs are associated and stored in a question library corresponding to the target business.

9. The method according to claim 6, characterized in that The target prompt text also includes question examples for each candidate intent category; the method also includes: Acquire a newly added intent category for the target business, and a second question type description text marked for the newly added intent category; The second largest language model generates a question based on the question generation prompt text and the newly added question type description text to obtain a second sample question text that conforms to the newly added question type description text; The second sample question text and the newly added intent category are associated and stored in a question library corresponding to the target business; The second sample question text, the newly added intent category and the intent category description annotated for the newly added intent category are added to the target prompt text, wherein the second sample question text serves as a question example of the newly added intent category in the target prompt text.

10. The method according to claim 6, characterized in that The target prompt text also includes question examples for each candidate intent category; the method also includes: Obtaining bad example problem text from the target business; Obtaining a labeling intention category for labeling the bad example question text and an intention category description for labeling the labeling intention category; Associating the bad example question text and the corresponding annotation intention category and storing them in the question library corresponding to the target business; The bad example question text, the corresponding marked intention category and the intention category description marked for the marked intention category are added to the target prompt text, wherein the bad example question text in the target prompt text serves as a question example of the marked intention category.

11. An intention classification device, characterized in that: include: A first acquisition module is used to acquire a question text and a target business identifier of a target business from which the question text originates; A second acquisition module is used to acquire a target prompt text associated with the target business identifier; the target prompt text includes a plurality of candidate intent categories of the target business, an intent category description of each candidate intent category, and a specific intent classification requirement under the target business; A first classification module is configured to perform intent classification on the question text according to the multiple candidate intent categories, the intent category descriptions of the candidate intent categories, and the specific intent classification requirements under the target business by using a first large language model to determine a first candidate intent category to which the question text belongs among the multiple candidate intent categories; A second classification module is used to perform intent classification on the question text by using an intent classification model, and determine a second candidate intent category to which the question text belongs from among the multiple candidate intent categories according to an intermediate intent classification result output by the intent classification model; An intention category determination module is used to determine a target intention category of the question text under the target business based on the first candidate intention category and the second candidate intention category.

12. An electronic device, characterized in that: include: processor; A memory having computer instructions stored thereon, wherein when the computer instructions are executed by the processor, the method described in any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.

14. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method described in any one of claims 1 to 10 is implemented.

Citation Information

Cited By

  • Intention recognition method, system and related device

    CN120973908A