An intent recognition model training method, a computer device, and a storage medium

By performing intent recognition and clustering on unlabeled text data, accurate labels are generated and model training is optimized, solving the problem of inaccurate pseudo-labels and improving the accuracy and efficiency of the intent recognition model.

CN116204639BActive Publication Date: 2026-03-03ZHAOLIAN CONSUMER FINANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-07
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In existing technologies, during the semi-supervised learning training process based on pseudo-labels, the pseudo-labels generated by the initial model are not accurate enough, resulting in insufficient accuracy of the intent recognition model.

Method used

By acquiring unlabeled text data, performing intent recognition and clustering, text data with first and second intent type labels is generated, and an initial model is trained based on these labels. The model is then optimized using cross-entropy loss and center loss functions.

Benefits of technology

It improves the accuracy of the intent recognition model, reduces the cost of manual annotation, and enhances the model's generalization ability and recognition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116204639B_ABST
    Figure CN116204639B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an intent recognition model training method, a computer device and a storage medium, which can be applied to artificial intelligence, cloud technology, Internet of Things and the like. The method comprises: obtaining first text data and second text data; the first text data is text data without a labeled intent type, and the second text data is reference text data with a labeled intent type; performing intent recognition on the first text data to obtain third text data; the third text data has a label of a first intent type; performing clustering processing on the first text data to obtain fourth text data; the fourth text data has a label of a second intent type; and training a first intent recognition model based on the second text data, the third text data and the fourth text data to obtain a second intent recognition model. By using the embodiments of the present application, the accuracy of the intent recognition model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an intent recognition model training method, computer device, and storage medium. Background Technology

[0002] In the intent recognition process, the system requires a large amount of labeled text data to build and train the initial model to achieve higher intent recognition accuracy. However, the labeled text data required by the system is difficult to obtain. Currently, in the semi-supervised learning training process based on pseudo-labels, a small amount of labeled text data is typically used to train the initial model. Then, the trained initial model is used to perform intent recognition on a large amount of unlabeled text data to obtain a large amount of text data with pseudo-labels. Based on the small amount of labeled text data and the large amount of text data with pseudo-labels, the trained initial model is trained again to obtain the intent recognition model. However, the pseudo-labels generated by the trained initial model may not be accurate enough. If the intent recognition model is trained on text data with inaccurate pseudo-labels, the intent recognition model will be inaccurate. Summary of the Invention

[0003] This invention provides an intent recognition model training method, a computer device, and a storage medium, which can improve the accuracy of the intent recognition model and thus improve the accuracy of intent recognition.

[0004] One embodiment of this application provides a method for training an intent recognition model, the method comprising:

[0005] Obtain first text data and second text data; the first text data is text data without an intent type label, and the second text data is reference text data with an intent type label;

[0006] The first text data is subjected to intent recognition to obtain the third text data; the third text data has a label of the first intent type.

[0007] Clustering is performed on the first text data to obtain the fourth text data; the fourth text data has labels of the second intent type.

[0008] The first intent recognition model is trained based on the second, third, and fourth text data to obtain the second intent recognition model.

[0009] One embodiment of this application provides an intent recognition model training device, including:

[0010] The acquisition module is used to acquire first text data and second text data; the first text data is text data without an intent type, and the second text data is reference text data with an intent type.

[0011] The processing module is used to perform intent recognition on the first text data to obtain the third text data; the third text data has a label of the first intent type; and to perform clustering processing on the first text data to obtain the fourth text data; the fourth text data has a label of the second intent type.

[0012] The training module is used to train the first intent recognition model based on the second, third, and fourth text data to obtain the second intent recognition model.

[0013] One embodiment of this application provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor executes the intent recognition model training method provided in this application embodiment.

[0014] One aspect of this application provides a computer storage medium storing a computer program, which includes program instructions. When the program instructions are executed by a processor, they execute the intent recognition model training method provided in this application.

[0015] One aspect of this application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by the processor of a computer device, the intent recognition model training method provided in this application is executed.

[0016] In this embodiment, a computer device acquires first text data without an labeled intent type and second text data with an labeled intent type, performs intent recognition on the first text data to obtain third text data with a first intent type label, and performs clustering processing on the first text data to obtain fourth text data with a second intent type label. Based on the second text data with an labeled intent type, the third text data with the first intent type label, and the fourth text data with the second intent type label, the first intent recognition model is trained to obtain a more accurate second intent recognition model, thereby improving the accuracy of the intent recognition model and improving the accuracy of intent recognition. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is an architecture diagram of an intent recognition model training system provided in an embodiment of this application;

[0019] Figure 2 This is a flowchart illustrating an intent recognition model training method provided in an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of an intent recognition process provided in an embodiment of this application;

[0021] Figure 4 This is a flowchart illustrating another intention recognition model training method provided in an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of the structure of an intent recognition model training device provided in an embodiment of this application;

[0023] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0025] This application provides an intent recognition model training method. It trains a first intent recognition model using second text data labeled with intent types, third text data with first intent type labels obtained by performing intent recognition on first text data without intent types, and fourth text data with second intent type labels obtained by clustering the first text data without intent types. This results in a more accurate second intent recognition model, thereby improving the accuracy of the intent recognition model and ultimately enhancing the overall accuracy of intent recognition. The intent recognition model training method provided in this application can be implemented using one or more artificial intelligence technologies.

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

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

[0028] Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0029] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, and smart customer service. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.

[0030] In feasible embodiments, the intent recognition model training method provided in this application can also be implemented based on cloud technology. Specifically, it may involve one or more of cloud technologies, such as cloud storage, cloud computing, and cloud database. For example, it may obtain first text data without intent type labeling and second text data with intent type labeling from a cloud database, or perform intent recognition on the first text data without intent type labeling through cloud computing, or store third text data with first intent type labeling and fourth text data with second intent type labeling through cloud storage.

[0031] Please see Figure 1 This is an architecture diagram of an intent recognition model training system provided in an embodiment of this application. The intent recognition model training system may include a computer device 10 and a database 11. The computer device 10 may be a server or terminal device with data processing and intent recognition model training functions; the server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, etc.; the terminal device may be a smartphone, tablet computer, laptop computer, desktop computer, intelligent voice interaction device, smart home appliance, vehicle terminal, etc., but is not limited to these.

[0032] Database 11 can be a local database of computer device 10, or a cloud database accessible by computer device 10. It should be noted that... Figure 1 The example described uses the storage of first, second, third, and fourth text data in database 11 as an example, and does not limit this application. Optionally, the first and second text data can be stored in one database, and the third and fourth text data can be stored in another database; this application does not impose any restrictions on this.

[0033] The intent recognition model training method provided in this application embodiment can be executed by computer device 10. Specifically, it involves: obtaining first text data without intent type labeling and second text data with intent type labeling from database 11; performing intent recognition on the first text data to obtain third text data with a label of the first intent type; and performing clustering processing on the first text data to obtain fourth text data with a label of the second intent type. Based on the second text data, third text data, and fourth text data, the first intent recognition model is trained to obtain a second intent recognition model with more accurate prediction results, thereby improving the accuracy of the intent recognition model.

[0034] Please see Figure 2 , Figure 2 This is a flowchart illustrating an intent recognition model training method provided in an embodiment of this application. This intent recognition model training method can be applied to... Figure 1 The intent recognition model training system shown is executed by a computer device, specifically by the computer device's processor. The intent recognition model training method includes the following steps:

[0035] S201, Obtain the first text data and the second text data.

[0036] The first text data can be text data without an intent type. In this embodiment, the computer device can obtain a large amount of text data without an intent type based on the outbound calling system, i.e., a large amount of first text data.

[0037] The second text data can be reference text data with an labeled intent type. It is understood that the labeled intent type can be used to indicate the intent of the text data, such as the domain or business to which the text data belongs, and this application does not impose any limitations on this. For example, assuming text data 1 is labeled with the intent type "savings," then this intent type can be used to indicate that the business involved in text data 1 is "savings."

[0038] Optionally, the computer device administrator can operate the computer device, such as by sending an intent recognition command, to annotate the text data without an intent type, thereby enabling the computer device to obtain the reference text data with an annotated intent type, i.e., the aforementioned second text data. Optionally, the computer device may also obtain the second text data through other means, and this application does not limit this.

[0039] It should be noted that the computer equipment administrator can select a portion of the text data obtained from the unlabeled intent type based on the outbound calling system, and then label that portion of the text data with intent type to obtain reference text data with labeled intent type. Optionally, the computer equipment administrator can also select a portion of the text data from the first text data, and then label that portion of the text data with intent type to obtain reference text data with labeled intent type; this application does not impose any restrictions on this.

[0040] It should be noted that while manual annotation can yield a small amount of second-level text data, this method is costly in terms of both manpower and time. Furthermore, as business expands, computer equipment can acquire increasingly more unannotated text data (i.e., first-level text data) from the outbound calling system. Performing intent recognition solely on this first-level text data through manual annotation is not only costly but also inefficient.

[0041] Based on this, in this embodiment of the application, the first text data is subjected to intent recognition and clustering processing by an intent recognition model (the first intent recognition model mentioned below), and the processed text data is used to train the intent recognition model again, so as to obtain an intent recognition model with more accurate intent recognition results (the second intent recognition model mentioned below).

[0042] like Figure 3 As shown, Figure 3 An exemplary flowchart of an intent recognition process is shown. Figure 3 It is known that computer devices can obtain voice data through outbound calling systems and call Automatic Speech Recognition (ASR) systems to convert the obtained voice data into text data. Then, the trained intent recognition model can be used to recognize the intent of the text data and obtain the intent type of the text data.

[0043] S202, perform intent recognition on the first text data to obtain the third text data.

[0044] The third text data may have a label of the first intent type. This first intent type label may be a pseudo-label for the first text data. That is, the third text data may be the first text data with a label of the first intent type. For example, assuming the computer device performs intent recognition on the first text data and determines that the first intent type of the first text data is intent A, then the third text data may be the first text data with the label "intent A".

[0045] Optionally, the computer device can invoke a first intent recognition model to perform intent recognition on the first text data to obtain the third text data. Optionally, the computer device can use pre-trained language models, such as Bidirectional Encoder Representations from Transformers (BERT) and Bidirectional Long Short-Term Memory (BiLSTM) networks, to construct a text compiler (encoder) for the intent recognition model to map the text data into text vectors.

[0046] It should be noted that the computer device can train the third intent recognition model (i.e., the initial model) based on reference text data with labeled intent types, i.e., the second text data, to obtain the first intent recognition model mentioned above.

[0047] In one implementation, it is assumed that the second text data has been labeled with P intent types; the computer device can call the third intent recognition model to perform intent recognition on the second text data, obtain P training intent types and P training intent type center points of the second text data; and train the third intent recognition model according to the difference rule to obtain the first intent recognition model.

[0048] It should be noted that the computer device can categorize the intent types marked in the second text data to obtain P intent types, where P is a positive integer. For example, assuming that the computer device can identify three intent types—"savings," "investment," and "loan"—after categorizing the intent types marked in the second text data, the computer device can determine that the second text data has been marked with 3 intent types.

[0049] The training intent type can be understood as the intent type determined during the training process. For example, during the training of the first intent recognition model, after the computer device performs intent recognition on the second text data, it can determine the training intent type of the second text data. For instance, during the training of the first intent recognition model, after the computer device performs intent recognition on the second text data, it can obtain three training intent types: "savings," "financial management," and "loan."

[0050] It should be noted that the difference rules followed during training may include reducing the difference between the P training intent types and the P intent types. Understandably, since the P intent types already labeled in the second text data are accurate, reducing the difference between the P training intent types and the P intent types during training can make the intent recognition model's recognition results more accurate.

[0051] Understandably, since the third intent recognition model can be an initial model, the training intent type obtained through intent recognition using this third intent recognition model may differ from the actual intent type. Therefore, computer devices can use labeled second text data to perform supervised training on the third intent recognition model to obtain a more accurate first intent recognition model, thereby improving the accuracy of intent recognition.

[0052] It should be noted that, due to the limited amount of second text data, the intent recognition results of the first intent recognition model trained on this limited amount of second text data may not be accurate enough. In other words, the first intent type label of the third text data identified by the first intent recognition model may not be accurate enough, i.e., it may differ from the actual intent type.

[0053] S203, perform clustering on the first text data to obtain the fourth text data.

[0054] The fourth text data may have a label of a second intent type. This label of the second intent type can be a pseudo-label of the first text data. That is, the fourth text data can be the first text data with a label of the second intent type. For example, assuming the computer device performs clustering processing on the first text data and determines that the second intent type of the first text data is intent D, then the fourth text data can be the first text data with the label "intent D".

[0055] Optionally, the computer device may invoke a first intent recognition model to perform clustering processing on the first text data to obtain the fourth text data. Optionally, the computer device may also invoke other models, such as models with clustering functions, to perform clustering processing on the first text data to obtain the fourth text data; this application does not impose any restrictions on this.

[0056] Optionally, the clustering function in the first intent recognition model or other models with clustering capabilities can be implemented using the k-means clustering algorithm. Alternatively, this clustering function can also be implemented using other clustering algorithms with centroids, such as k-means++ or bi-kmeans clustering (bisecting k-means). This application does not impose any restrictions on this approach.

[0057] In one implementation, the computer device can perform clustering processing on the first text data to obtain Q categories and Q category centroids; based on the P intent type centroids of the second text data, determine the intent types of the Q categories; based on the intent types of the Q categories, determine the second intent type; and based on the first text data and the second intent type, obtain the fourth text data. Here, Q is a positive integer, and P is a positive integer.

[0058] Since the loss function of the intent recognition model provided in this application can be constructed using the cross-entropy loss function and the center loss function, the intent recognition model provided in this application can determine not only P intent types but also P center points of intent types during the intent recognition process. The center point of an intent type can be used to indicate the central location of that intent type.

[0059] The computer device can invoke a first intent recognition model to perform intent recognition on the second text data, thereby obtaining P intent types and P intent type center points of the second text data. It is understood that since the P intent types of the second text data are fixed, the computer device can obtain the P intent type center points of these P intent types by invoking the first intent recognition model; this application does not impose any limitations on this.

[0060] Optionally, the computer device can use a third intent recognition model to perform intent recognition on the second text data to obtain P intent types and P intent type center points of the second text data. This application does not impose any limitations on this. For example, the computer device can obtain the P intent types and P intent type center points of the second text data during the training of the third intent recognition model based on the second text data.

[0061] As described above, an intent type center point can be used to indicate the center position of an intent type; similarly, a category center point can be used to indicate the center position of a category. Optionally, the number of categories can be equal to the number of intent types, i.e., Q can be equal to P, so that Q categories can correspond one-to-one with P intent types. Optionally, the number of categories may not be equal to the number of intent types; this application does not impose any restrictions on this.

[0062] It should be noted that while computer devices can categorize the first text data by performing clustering, they cannot determine the intent type of each category. For example, assuming the first text data includes 1000 text entries, the computer device can categorize the first text data into three categories, such as Category 1, Category 2, and Category 3.

[0063] In one implementation, the computer device can determine the target intent type center point that is closest to the q-th category center point from among the P intent type center points of the second text data; and determine the intent type to which the target intent type center point belongs as the second intent type of the q-th category. Where 1 ≤ q ≤ Q, and q is a positive integer.

[0064] Here, the q-th category can be any one of the Q categories, and the center point of the q-th category can be used to indicate the center position of the q-th category. For example, assuming Q is 3, that is, the second text data can be classified into 3 categories, which can be category 1, category 2 and category 3 respectively, then the q-th category mentioned above can be category 3, and the center point of the q-th category can be the center position of category 3.

[0065] It should be noted that the computer device can determine the qth category center point from the Q category center points, and obtain the target intent type center point that is closest to the qth category center point by calculating the distance between the qth category center point and the P intent type center points.

[0066] Optionally, the computer device can determine the target intent type center point by calculating the Euclidean distance between the q-th category center point and the P intent type center points; this application does not impose any limitations on this method. Optionally, the computer device can also use other calculation formulas to determine the target intent type center point that is closest to the q-th category center point; this application does not impose any limitations on this method.

[0067] Furthermore, after determining the target intent type center point, the computer device can identify the intent type described by the target intent type center point as the second intent type of the q-th category. It is understood that the computer device can perform the aforementioned distance calculation process on each of the Q category center points to determine the second intent type of each of the Q categories.

[0068] For example, assuming Q and P are 3, and P intention types are "savings", "investment" and "loan", if the category centroid 1 among the 3 category centroids is closest to the intention type centroid of "savings", then the second intention type of category 1 is confirmed as "savings"; if the category centroid 2 among the 3 category centroids is closest to the intention type centroid of "loan", then the intention type of category 2 is confirmed as "loan"; if the category centroid 3 among the 3 category centroids is closest to the intention type centroid of "investment", then the intention type of category 3 is confirmed as "investment".

[0069] It is understood that after determining Q categories of intent types based on P intent type center points of the second text data, the computer device can determine the second intent type of the first text data according to the Q intent types to obtain the fourth text data. Optionally, the computer device may also obtain the fourth text data with the second intent type label through other means, and this application does not limit this.

[0070] S204. Based on the second text data, the third text data, and the fourth text data, the first intent recognition model is trained to obtain the second intent recognition model.

[0071] As discussed above, training a first intent recognition model based on a small amount of second text data may not be accurate enough. Therefore, the first intent type labels on the third text data and the second intent type labels on the fourth text data obtained by the computer device through the first intent recognition model may also be inaccurate.

[0072] Therefore, during the training of the first intent recognition model, the computer device can use different weight parameters for different input text data, thereby increasing the impact of more accurate text data on the training of the first intent recognition model and reducing the impact of less accurate text data on the training of the first intent recognition model, thus obtaining a more accurate second intent recognition model.

[0073] In one implementation, a computer device can process second text data to determine a first weight parameter; process a portion of third text data to determine a second weight parameter; process another portion of third text data to determine a third weight parameter; determine a loss function based on the first, second, and third weight parameters; and train a first intent recognition model based on the second, third, and fourth text data and the loss function to obtain a second intent recognition model.

[0074] In this context, some of the third text data may have the same tags as the fourth text data; other parts of the third text data may have different tags than the fourth text data. For example, the relationship between some and other parts of the third text data can be seen in the following formula:

[0075] U1=1∩S2

[0076] U2 = 1 - U1

[0077] Wherein, U1 can be used to represent a portion of the third text data, U2 can be used to represent another portion of the third text data, S1 can be used to represent the first intent type label, and S2 can be used to represent the second intent type label.

[0078] For example, if the first intent type label of the third text data is "savings", "investment" and "loan", and the second intent type label of the fourth text data is "savings", "financial management" and "loan", then part of the third text data can be text data labeled "savings" and "loan", and another part of the third text data can be text data labeled "investment".

[0079] It should be noted that if the labels of the third text data are the same as those of the fourth text data, it indicates that the first intent type obtained through intent recognition and the second intent type obtained through clustering are the same, and thus the text data with the same labels can be considered to have high credibility. Optionally, if the labels of the third text data are different from those of the fourth text data, it indicates that the first intent type obtained through intent recognition and the second intent type obtained through clustering are different, and thus the text data with different labels can be considered to have low credibility.

[0080] The second weight parameter can be less than or equal to the first weight parameter. It is understood that, for text data with high credibility, the second weight parameter determined by the computer device can be equal to or less than the first weight parameter to increase the impact of the highly credible text data on the training of the intent recognition model. For example, if the first weight parameter is 1, the second weight parameter can be 0.8; this application does not impose any limitation on this.

[0081] Optionally, the third weight parameter can be smaller than the second weight parameter. It is understood that, for text data with low credibility, the third weight parameter determined by the computer device can be smaller than the second weight parameter to reduce the impact of the low-credibility text data on the training of the intent recognition model. For example, if the second weight parameter is 0.8, then the third weight parameter can be 0.2; this application does not impose any limitation on this.

[0082] Optionally, the computer device may also avoid using text data with low credibility. That is, it can train the first intent recognition model using second text data and text data with high credibility to remove the influence of text data with low credibility on the training of the intent recognition model, thereby making the trained second intent recognition model more accurate.

[0083] In one implementation, the computer device can determine the loss function based on the cross-entropy loss function and the center loss function, according to a first weight parameter, a second weight parameter, and a third weight parameter.

[0084] Specifically, the cross-entropy loss function can be found in the following formula:

[0085]

[0086] Where N can be the number of texts used to train the intent recognition model; for example, if N is 128, then in one intent recognition model training process, the computer device can use 128 text data to train the intent recognition model; c can be the intent type, and the number of intent types can be k+1; v i It can be a text vector, that is, a vector representation of text data; c i It can be a text vector v i The intent type to which it belongs; t can be any intent type, and the value of t ranges from 0 to k; c t It can be any intent type in the text vector.

[0087] Specifically, the center loss function can be found in the following formula:

[0088] L2 = 0.5 * (v i -p i ) 2

[0089] Where, p i It can be text data v i The intent type center point of the intent type to which it belongs. It can be understood that the number of such intent type center points can also be k+1.

[0090] Furthermore, the loss function determined by the computer device based on the cross-entropy loss function and the center loss function can be seen in the following formula:

[0091] Loss = L1 + γ * L2

[0092] Here, γ can be a hyperparameter, which can take values ​​such as 0.1 or 0.001. It should be noted that this hyperparameter can be used to control the center point of the intent type corresponding to each intent type.

[0093] Understandably, the loss function determined by the computer device based on the first weight parameter, the second weight parameter, and the third weight parameter can be seen in the following formula:

[0094]

[0095] Where α and β can be hyperparameters, which can be set according to actual needs; L3 can be the cross-entropy loss function when using the intent recognition model to determine the first intent type; L4 can be the cross-entropy loss function when using k-means and intent type centroids to determine the second intent type; x i D1 can be the input text data; D2 can be the reference text data with an labeled intent type, i.e., the second text data; D3 can be the text data without an labeled intent type, i.e., the first text data.

[0096] It should be noted that computer devices can input the i-th piece of text data, i.e., x, into the intent recognition model. i Based on the text compiler in the intent recognition model, the i-th text data can be mapped to a text vector, i.e., the aforementioned v. i Then, the intent recognition model is trained based on this text vector.

[0097] For example, if the currently input text data is text data in the second text data, i.e., text data in D1, then α and β can both be 0; if the currently input text data is text data in the first text data, i.e., text data in D2, and the text data has a high degree of confidence, then α and β can both be 0.5; if the currently input text data is text data in the first text data, i.e., text data in D2, and the text data has a low degree of confidence, then α and β can both be 0.1.

[0098] It should be noted that by combining intent recognition models with clustering methods (such as k-means clustering), computer devices can dynamically generate pseudo-labels (such as first intent type labels and second intent type labels) for text data without labeled intent types. By using a determined loss function, the optimization of the model by pseudo-labels with higher credibility is enhanced, while the impact of pseudo-labels with lower credibility on the model is reduced, thereby improving the accuracy of the intent recognition model and thus enhancing the accuracy of intent recognition.

[0099] Understandably, after obtaining a more accurate second intent recognition model, the computer device can again use the second intent recognition model to perform intent recognition on the first text data to obtain the fifth text data with a third intent type label, and then perform clustering processing on the second text data to obtain the sixth text data with a fourth intent type label. Based on the second, fifth, and sixth text data, the second intent recognition model can be trained to obtain a more accurate intent recognition model (such as called the fourth intent recognition model), thereby continuously improving the accuracy of the intent recognition model.

[0100] With a small amount of reference text data with labeled intent types, computer devices can continuously train and optimize intent recognition models based on a large amount of unlabeled text data with pseudo-labels (such as first intent type label and second intent type label). This not only saves a lot of labor and time costs for intent recognition, but also improves the generalization ability of intent recognition models, thereby improving the efficiency and accuracy of intent recognition.

[0101] In this embodiment, the computer device acquires first text data without labeled intent type and second text data with labeled intent type, performs intent recognition on the first text data to obtain third text data with a label of the first intent type, and performs clustering processing on the first text data to obtain fourth text data with a label of the second intent type. Thus, the first intent recognition model can be trained based on the second, third, and fourth text data to obtain a second intent recognition model with more accurate prediction results, thereby improving the accuracy of the intent recognition model and improving the accuracy of intent recognition.

[0102] Please see Figure 4 , Figure 4 This is a flowchart illustrating another intention recognition model training method provided in an embodiment of this application. This intention recognition model training method can be applied to... Figure 1 The intent recognition model training system shown is executed by a computer device, specifically by the computer device's processor. The intent recognition model training method includes the following steps:

[0103] S401, Obtain first text data and second text data; wherein, the first text data is text data without an labeled intent type, and the second text data is reference text data with an labeled intent type.

[0104] It should be noted that the amount of the first text data can be much greater than the amount of the second text data, and this application does not impose any restrictions on this.

[0105] S402, the initial model is trained based on the second text data to obtain the first intent recognition model.

[0106] S403, invoke the first intent recognition model to perform intent recognition on the first text data to obtain the third text data; wherein, the third text data may have a label of the first intent type.

[0107] S404, perform clustering processing on the first text data to obtain Q categories and Q category centroids of the first text data.

[0108] S405, Based on the P intent type center points of the second text data, determine the Q categories of intent types of the first text data; wherein, the P intent type center points of the second text data can be obtained by calling the first intent recognition model to perform intent recognition processing on the second text data.

[0109] S406, Based on the Q categories of intent types, determine the second intent type.

[0110] S407, based on the first text data and the second intent type, obtain the fourth text data; wherein, the fourth text data may have a label of the second intent type.

[0111] S408, based on the second text data, the third text data, and the fourth text data, the first intent recognition model is trained to obtain the second intent recognition model.

[0112] It should be noted that the relevant content of S401-S408 above can be found in the aforementioned... Figure 2 The detailed descriptions in the corresponding embodiments are not repeated here.

[0113] In this embodiment, the computer device acquires first text data without labeled intent type and second text data with labeled intent type. It can train an initial model based on the second text data to obtain a first intent recognition model. Then, it uses the first intent recognition model to perform intent recognition on the first text data to obtain third text data with a label of the first intent type. Finally, it performs clustering processing on the first text data to obtain fourth text data with a label of the second intent type. Thus, the first intent recognition model can be trained based on the second, third, and fourth text data to obtain a second intent recognition model with more accurate prediction results, thereby improving the accuracy of the intent recognition model and improving the accuracy of intent recognition.

[0114] Furthermore, in the specific embodiments of this application, the first text data, second text data, third text data, and fourth text data, as well as related data in the process of intent recognition and clustering, are all involved, and all data used is authorized by the user. When the above embodiments of this application are applied to specific products or technologies, the data used must obtain user permission or consent, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0115] For further details, please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an intent recognition model training device provided in an embodiment of this application. Figure 5 As shown, the intent recognition model training device 500 can be applied to the above-mentioned Figure 1The computer device in the corresponding embodiment. Specifically, the intent recognition model training device 500 can be a computer program (including program code) running on the computer device, for example, the intent recognition model training device 500 is an application software; the intent recognition model training device 500 can be used to execute Figure 2 and Figure 4 The corresponding steps in the method provided in the corresponding embodiment.

[0116] The intent recognition model training device 500 may include: an acquisition unit 501, a processing unit 502, and a training unit 503.

[0117] The acquisition unit 501 is used to acquire first text data and second text data; the first text data is text data without an intent type, and the second text data is reference text data with an intent type.

[0118] Processing unit 502 is used to perform intent recognition on the first text data to obtain third text data; the third text data has a label of the first intent type; and to perform clustering processing on the first text data to obtain fourth text data; the fourth text data has a label of the second intent type.

[0119] Training unit 503 is used to train the first intent recognition model based on the second text data, the third text data, and the fourth text data to obtain the second intent recognition model.

[0120] In one implementation, the intent recognition model training device 500 may further include a determination unit 504. The aforementioned processing unit 502 is further configured to perform clustering processing on the first text data to obtain Q categories and Q category centroids of the first text data; a category centroid indicates the center position of a category, where Q is a positive integer; the determination unit 504 is further configured to determine the intent types of the Q categories based on P intent type centroids of the second text data; an intent type centroid indicates the center position of an intent type, where P is a positive integer; determine the second intent type based on the Q categories of intent types; and obtain fourth text data based on the first text data and the second intent type.

[0121] In one implementation, the determining unit 504 is further configured to determine, from the P intent type center points of the second text data, the target intent type center point that is closest to the q-th category center point; 1≤q≤Q, where q is a positive integer; and to determine the intent type to which the target intent type center point belongs as the second intent type of the q-th category.

[0122] In one implementation, the processing unit 502 is further configured to call the first intent recognition model to perform intent recognition on the second text data and obtain P intent type center points of the second text data.

[0123] In one implementation, the second text data has been labeled with P intent types; the processing unit 502 is further configured to call a third intent recognition model to perform intent recognition on the second text data, and obtain P training intent types and P training intent type center points of the second text data; and train the third intent recognition model according to the difference rules to obtain a first intent recognition model; the difference rules include reducing the difference between the P training intent types and the P intent types.

[0124] In one implementation, the determining unit 504 is further configured to process the second text data to determine a first weight parameter; process a portion of the third text data to determine a second weight parameter; wherein the labels of the portion of the third text data are the same as those of the fourth text data, and the second weight parameter is less than or equal to the first weight parameter; process another portion of the third text data to determine a third weight parameter; wherein the labels of the other portion of the third text data are different from those of the fourth text data, and the third weight parameter is less than the second weight parameter; and determine a loss function based on the first weight parameter, the second weight parameter, and the third weight parameter; the processing unit 502 is further configured to train the first intent recognition model based on the second text data, the third text data, the fourth text data, and the loss function to obtain a second intent recognition model.

[0125] In one implementation, the determining unit 504 is further configured to determine a loss function based on the cross-entropy loss function and the center loss function, according to the first weight parameter, the second weight parameter, and the third weight parameter.

[0126] According to the embodiments of this application, Figure 5 The units in the intent recognition model training device shown can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above units are based on logical function division. In practical applications, the function of one unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the intent recognition model training device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0127] According to embodiments of this application, it is possible to execute functions such as those described above by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 2 and Figure 4 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 5 The diagram illustrates an intent recognition model training apparatus and a method for implementing the intent recognition model training embodiments of this application. The computer program described above can be stored on, for example, a computer storage medium, loaded onto the aforementioned computing device via the computer storage medium, and run therein.

[0128] Further, please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. This computer device 600 can also be used to implement the functions of the computer device in the above method embodiments. For example... Figure 6 As shown, the computer device 600 may include at least: a processor 601, a communication interface 602, and a computer storage medium 603. The processor 601, communication interface 602, and computer storage medium 603 may be connected via a bus or other means.

[0129] Computer storage medium 603 can be stored in memory 604 of computer device 600. This computer storage medium 603 is used to store computer programs, which include program instructions. The processor 601 is used to execute the program instructions stored in the computer storage medium 603. Processor 601 (or CPU (Central Processing Unit)) is the computing and control core of computer device 600, suitable for implementing one or more instructions, specifically suitable for loading and executing:

[0130] Obtain first text data and second text data; the first text data is text data without an intent type label, and the second text data is reference text data with an intent type label;

[0131] The first text data is subjected to intent recognition to obtain the third text data; the third text data has a label of the first intent type.

[0132] Clustering is performed on the first text data to obtain the fourth text data; the fourth text data has labels of the second intent type.

[0133] The first intent recognition model is trained based on the second, third, and fourth text data to obtain the second intent recognition model.

[0134] In one implementation, the processor 601 is further configured to perform clustering processing on the first text data to obtain Q categories and Q category centroids of the first text data; a category centroid indicates the center position of a category, where Q is a positive integer; determine the intent types of Q categories based on P intent type centroids of the second text data; an intent type centroid indicates the center position of an intent type, where P is a positive integer; determine the second intent type based on the intent types of the Q categories; and obtain fourth text data based on the first text data and the second intent type.

[0135] In one implementation, the processor 601 is further configured to determine, from the P intent type center points of the second text data, the target intent type center point that is closest to the q-th category center point; 1≤q≤Q, where q is a positive integer; and to determine the intent type to which the target intent type center point belongs as the second intent type of the q-th category.

[0136] In one implementation, the processor 601 is further configured to call a first intent recognition model to perform intent recognition on the second text data and obtain P intent type center points of the second text data.

[0137] In one implementation, the second text data has been labeled with P intent types; the processor 601 is further configured to call a third intent recognition model to perform intent recognition on the second text data, thereby obtaining P training intent types and P training intent type center points of the second text data; and to train the third intent recognition model according to the difference rules to obtain a first intent recognition model; the difference rules include reducing the difference between the P training intent types and the P intent types.

[0138] In one implementation, the processor 601 is further configured to process the second text data to determine a first weight parameter; process a portion of the third text data to determine a second weight parameter; wherein the labels of the portion of the third text data are the same as those of the fourth text data, and the second weight parameter is less than or equal to the first weight parameter; process another portion of the third text data to determine a third weight parameter; wherein the labels of the other portion of the third text data are different from those of the fourth text data, and the third weight parameter is less than the second weight parameter; determine a loss function based on the first weight parameter, the second weight parameter, and the third weight parameter; and train a first intent recognition model based on the second text data, the third text data, the fourth text data, and the loss function to obtain a second intent recognition model.

[0139] In one implementation, the processor 601 is further configured to determine a loss function based on the cross-entropy loss function and the center loss function, according to a first weight parameter, a second weight parameter, and a third weight parameter.

[0140] It should be understood that the computer device 600 described in the embodiments of this application can perform the foregoing... Figure 2 and Figure 4 The description of the intent recognition model training method in the corresponding embodiments can also be performed as described above. Figure 5 The description of the intent recognition model training device 500 in the embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0141] Furthermore, it should be noted that this application embodiment also provides a computer storage medium, which stores the computer program executed by the aforementioned intent recognition model training device 500. The computer program includes program instructions, and when the processor executes the program instructions, it can execute the aforementioned... Figure 2 and Figure 4 The description of the intent recognition model training method in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer storage medium embodiments related to this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed and executed on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network. Multiple computer devices distributed across multiple locations and interconnected via a communication network can be combined to form a blockchain network.

[0142] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned... Figure 2 and Figure 4 The methods described in the corresponding embodiments are therefore not repeated here.

[0143] Those skilled in the art will recognize that the units and steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0144] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0145] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this invention should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for training an intent recognition model, the method comprising: The method comprises: obtaining first text data and second text data; the first text data is text data of an unannotated attention graph type, and the second text data is reference text data of an annotated attention graph type; performing intent recognition on the first text data to obtain third text data; the third text data has a label of a first intent type; performing clustering processing on the first text data to obtain fourth text data, the fourth text data having a label of a second intent type; the clustering processing comprises: performing clustering processing on the first text data to obtain Q categories of the first text data and Q category center points; one category center point indicates the central position of one category, wherein Q is a positive integer; determining the intent types of the Q categories based on P intent type center points of the second text data; one intent type center point indicates the central position of one intent type, wherein P is a positive integer; determining the second intent type based on the intent types of the Q categories; obtaining the fourth text data based on the first text data and the second intent type; training a first intent recognition model based on the second text data, the third text data, and the fourth text data to obtain a second intent recognition model.

2. The method of claim 1, wherein, The determination of the intent types of the Q categories based on the P intent type center points of the second text data comprises: determining a target intent type center point closest to the qth category center point from the P intent type center points of the second text data; 1≤q≤Q, q is a positive integer; determining the intent type to which the target intent type center point belongs as the second intent type of the qth category.

3. The method of claim 1, wherein, The method further comprises: calling the first intent recognition model to perform intent recognition on the second text data to obtain the P intent type center points of the second text data.

4. The method of claim 1, wherein, The second text data has P annotated intent types; the method further comprises: calling a third intent recognition model to perform intent recognition on the second text data to obtain P training intent types and P training intent type center points of the second text data; training the third intent recognition model according to a difference rule to obtain the first intent recognition model; the difference rule comprises reducing the difference between the P training intent types and the P intent types.

5. The method of claim 1, wherein, The training of the first intent recognition model based on the second text data, the third text data, and the fourth text data to obtain the second intent recognition model comprises: processing the second text data to determine a first weight parameter; processing part of the third text data to determine a second weight parameter; the part of the third text data has the same label as the label of the fourth text data, and the second weight parameter is less than or equal to the first weight parameter; processing another part of the third text data to determine a third weight parameter; the another part of the third text data has a label different from the label of the fourth text data; the third weight parameter is less than the second weight parameter; determining a loss function according to the first weight parameter, the second weight parameter and the third weight parameter; training the first intent recognition model based on the second text data, the third text data and the fourth text data, and the loss function to obtain the second intent recognition model.

6. The method of claim 5, wherein, The determining a loss function according to the first weight parameter, the second weight parameter and the third weight parameter comprises: determining the loss function according to the first weight parameter, the second weight parameter and the third weight parameter based on a cross-entropy loss function and a center loss function. 7.An intention recognition model training apparatus, comprising: comprises: an acquisition module configured to acquire first text data and second text data; the first text data is text data without an annotated intent type, and the second text data is reference text data with an annotated intent type; a processing module configured to perform intent recognition on the first text data to obtain third text data; the third text data has a label of a first intent type; The processing module is further configured to perform clustering processing on the first text data to obtain fourth text data, and the fourth text data has a label of a second intent type; the processing module comprises: performing clustering processing on the first text data to obtain Q categories of the first text data and Q category center points; one category center point indicates a center position of one category, wherein Q is a positive integer; determining intent types of the Q categories based on P intent type center points of the second text data; one intent type center point indicates a center position of one intent type, wherein P is a positive integer; determining the second intent type based on the intent types of the Q categories; and obtaining the fourth text data based on the first text data and the second intent type; a training module configured to train a first intent recognition model based on the second text data, the third text data and the fourth text data to obtain a second intent recognition model.

8. A computer device, comprising: The computer readable storage medium stores a computer program, and the computer program comprises program instructions which, when executed by a processor, cause a computer device having the processor to perform the steps of the method in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program comprises program instructions which, when executed by a processor, cause a computer device having the processor to perform the steps of the method in any one of claims 1-6.

Citation Information

Patent Citations

  • Intention recognition model training method, intention recognition method, intention recognition device and intention recognition equipment

    CN113343709A