User intention recognition method and device, dialogue system, equipment and storage medium

By processing the text to be recognized into a model, the efficiency of recognition is improved, the vector length of the model is increased, the accuracy of recognition is enhanced, and the real-time requirements are met.

CN115238066BActive Publication Date: 2026-06-02BEIJING SANKUAI ONLINE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SANKUAI ONLINE TECH CO LTD
Filing Date
2021-04-23
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, intent recognition methods are limited by the maximum length of the input vector, making them unsuitable for scenarios with a large number of candidate intents, resulting in low recognition efficiency.

Method used

The text to be recognized is processed into a sequence of word vectors, the description of the candidate intent is converted into sentence vectors, and then matched by a concatenated vector model. By using a binary or N-classifier recognition method, the vector length of the candidate intent is shortened, adapting to the vector length limitation of the model, increasing the number of recognizable scenarios, and improving the recognition efficiency.

Benefits of technology

While maintaining the model, it improved recognition efficiency, increased the number of scenarios that can be spliced ​​together, and met the real-time requirements of the dialogue system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115238066B_ABST
    Figure CN115238066B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a user intention recognition method and device, equipment and storage medium, and relate to the technical field of computer, aiming to improve the efficiency and accuracy of intention recognition, the method comprises: obtaining a to-be-recognized text and a plurality of candidate intention description sentences; processing the plurality of candidate intention description sentences to obtain a plurality of candidate intention corresponding sentence vectors; splicing each word vector corresponding to each word in the to-be-recognized text to obtain a word vector sequence corresponding to the to-be-recognized text; determining a user intention matching the to-be-recognized text from the plurality of candidate intentions based on the word vector sequence corresponding to the to-be-recognized text and the plurality of candidate intention corresponding sentence vectors.
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 a user intent recognition method, apparatus, dialogue system, device, and storage medium. Background Technology

[0002] In recent years, products centered around dialogue systems, such as smart speakers and intelligent customer service, have gradually come into the public eye. These dialogue systems involve robots answering user questions, manifesting as a dialogue where the user asks and the robot answers. Therefore, it is necessary to recognize the user's intent in their questions to determine their true intention, and then provide feedback to the user matching that true intent.

[0003] In related technologies, intent recognition refers to identifying input text to determine the user's true intent. A common method is text classification, which involves concatenating the vector of the text to be recognized with the vectors of multiple candidate intent descriptions and then inputting the concatenation into a model for matching. Based on the matching results, the user's true intent is obtained.

[0004] However, this approach is often limited by the maximum length of the input vector, making it unsuitable for scenarios with a large number of candidate intentions and resulting in low intention recognition efficiency. Summary of the Invention

[0005] To address the aforementioned issues, this application provides a user intent recognition method, apparatus, dialogue system, device, and storage medium, aiming to improve the efficiency of intent recognition.

[0006] A first aspect of this disclosure provides a user intent recognition method, the method comprising:

[0007] Obtain the text to be identified, as well as the description statements of each of the multiple candidate intents;

[0008] The description statements of each of the multiple candidate intentions are processed to obtain the sentence vectors corresponding to each of the multiple candidate intentions;

[0009] The word vectors corresponding to each word in the text to be identified are concatenated to obtain the word vector sequence corresponding to the text to be identified.

[0010] Based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the multiple candidate intentions, the user intention that matches the text to be identified is determined from the multiple candidate intentions.

[0011] Optionally, the description statements of each of the plurality of candidate intents are processed to obtain sentence vectors corresponding to each of the plurality of candidate intents, including:

[0012] The description statements of each of the multiple candidate intentions are input into a pre-trained vector transformation model to obtain the sentence vectors corresponding to each of the multiple candidate intentions;

[0013] The vector conversion model is obtained by training a first preset model using the description statements corresponding to the intentions of multiple samples as training data.

[0014] Optionally, the description statements of each of the plurality of candidate intents are processed to obtain sentence vectors corresponding to each of the plurality of candidate intents, including:

[0015] For each candidate intent description, perform the following steps:

[0016] Obtain the word vectors corresponding to each word in the description of the candidate intent;

[0017] The multiple word vectors obtained are compressed into a single vector to obtain the sentence vector corresponding to the candidate intent.

[0018] Optionally, based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the plurality of candidate intents, the user intent matching the text to be identified is determined from the plurality of candidate intents, including:

[0019] The word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to the multiple candidate intentions are concatenated to obtain the first concatenated vector;

[0020] The first concatenated vector is input into the first intent recognition model to obtain the user intent that matches the text to be recognized, output by the first intent recognition model.

[0021] The first intent recognition model is trained on the second preset model using multiple concatenated vector samples carrying labels as training samples. The concatenated vector samples are formed by concatenating the word vector sequence corresponding to the sample text and the sentence vectors corresponding to the multiple sample candidate intents. The labels are used to represent the intent that matches the concatenated vector samples.

[0022] Optionally, based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the plurality of candidate intents, the user intent matching the text to be identified is determined from the plurality of candidate intents, including:

[0023] The word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to the multiple candidate intentions are concatenated to obtain a second concatenated vector;

[0024] The second concatenated vector is input into the second intent recognition model to obtain the user intent that matches the text to be recognized, output by the second intent recognition model.

[0025] The second intent recognition model is trained on the third preset model using multiple concatenated vector samples carrying dual labels as training data; the concatenated vector samples are formed by concatenating the corresponding word vector sequence of the sample text and the sentence vectors corresponding to each of the multiple sample candidate intents.

[0026] One of the dual labels is a classification label used to characterize the intent to match the concatenated vector sample, and the other is a matching label used to characterize whether the sentence vector corresponding to each of the multiple sample candidate intents matches the word vector sequence corresponding to the sample text.

[0027] Optionally, the second intent recognition model is obtained through the following steps:

[0028] The multiple concatenated vector samples carrying dual labels are input into the third preset model;

[0029] Obtain the classification prediction result and matching prediction result output by the third preset model, wherein the classification prediction result is used to characterize the intent matching the concatenated vector sample, and the matching prediction result is used to characterize whether the sentence vector corresponding to each of the multiple sample candidate intents matches the word vector sequence corresponding to the sample text;

[0030] Based on the classification prediction result and the classification label, determine the classification loss, and based on the matching prediction result and the matching label, determine the matching loss;

[0031] The third preset model is updated based on the classification loss and the matching loss;

[0032] The third preset model obtained after multiple updates is determined as the second intent recognition model.

[0033] Optionally, the third preset model is updated based on the classification loss and the matching loss, including:

[0034] Based on the weights corresponding to the classification loss and the matching loss, the classification loss and the matching loss are fused to obtain the overall loss;

[0035] The third preset model is updated based on the overall loss.

[0036] A second aspect of this disclosure provides a user intent recognition device, the device comprising:

[0037] The acquisition module is used to acquire the text to be identified, as well as the description statements of each of the multiple candidate intents;

[0038] The processing module is used to process the description statements of each of the multiple candidate intents to obtain the sentence vectors corresponding to each of the multiple candidate intents;

[0039] The concatenation module is used to concatenate the word vectors corresponding to each word in the text to be identified, so as to obtain the word vector sequence corresponding to the text to be identified;

[0040] The recognition module is used to determine the user intent that matches the text to be recognized from the multiple candidate intents based on the word vector sequence corresponding to the text to be recognized and the sentence vectors corresponding to each of the multiple candidate intents.

[0041] A third aspect of this disclosure provides a dialogue system, including a speech recognition module, an intent recognition module, and a dialogue module; wherein:

[0042] The speech recognition module is used to recognize the received speech as text.

[0043] The intent recognition module is used to execute the user intent recognition method described in the first aspect embodiment to output the user intent that matches the text to be recognized;

[0044] The dialogue module is used to output natural speech based on the user's intent.

[0045] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements the user intent recognition method as described in the first aspect.

[0046] This disclosure also provides a non-transitory computer-readable storage medium that, when the instructions in the storage medium are executed by a processor, can perform the operations performed by the user intent recognition method described in any one of the first aspects.

[0047] In this embodiment, the text to be identified and the descriptive statements of multiple candidate intents can be obtained; the descriptive statements of the multiple candidate intents are processed to obtain the sentence vectors corresponding to the multiple candidate intents; then, the word vectors corresponding to each word in the text to be identified are concatenated to obtain the word vector sequence corresponding to the text to be identified; then, based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to the multiple candidate intents, the user intent matching the text to be identified is determined from the multiple candidate intents.

[0048] On the one hand, by processing the text to be recognized as a sequence of word vectors and combining the descriptions of multiple candidate intents into a single sentence vector, the length of the candidate intent vector is shortened. Consequently, when the vector of the text to be recognized is subsequently concatenated with the vectors of multiple candidate intents, the length of the resulting vector is significantly reduced, allowing for the concatenation of a larger number of candidate intents and improving the efficiency of intent recognition. On the other hand, because the length of the candidate intent vector is shortened, the proportion of each candidate intent in the concatenated vector is reduced. Conversely, since the text to be recognized is processed as a sequence of word vectors (the length of a word vector sequence is greater than that of a sentence vector), the proportion of the text vector in the concatenated vector is increased. This allows the information of the text to be preserved to the greatest extent possible, enabling full utilization of the information in the text for intent recognition and thus improving the accuracy of intent recognition. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments or related technologies 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.

[0050] Figure 1 This is a flowchart illustrating the steps of a user intent recognition method according to an embodiment of this application;

[0051] Figure 2 This is a schematic diagram illustrating the use of spliced ​​vector samples to train a third preset model, as shown in one embodiment of this application.

[0052] Figure 3 This is a flowchart illustrating the steps of training a second intent recognition model according to an embodiment of this application;

[0053] Figure 4 This is a schematic diagram of the framework of a user intent recognition device according to an embodiment of this application;

[0054] Figure 5 This is a schematic diagram of the framework of a dialogue system shown in one embodiment of this application. Detailed Implementation

[0055] 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, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0057] To facilitate understanding of the technical solution of this application, the technical terms used in this application are explained as follows:

[0058] Candidate intent description: Candidate intent can be understood as intents that reflect user needs and are pre-stored by the system. The description of a candidate intent can be a standard text that describes the intent. For example, if the candidate intent is "refund", then the description could be "I want a refund".

[0059] A word vector sequence is a sequence of vectors obtained by concatenating the vectors of each word in a text. For example, if the text is "I want to check my balance", then the word vector sequence is the concatenated vector of the vectors of "I", "want", "check", and "balance". Of course, this is just an example; in practice, the segmentation of words in a text can be determined based on the specific circumstances.

[0060] In related technologies, the main methods for intent recognition are as follows:

[0061] One approach, as described in the background, involves concatenating the vector of the text to be identified with the vectors of multiple intent descriptions used as labels, and then inputting this concatenation into a model for matching to determine the user's true intent. This method is also known as the N-classifier recognition method. However, this approach is often limited by the model's maximum length constraint on the input vector, making it unsuitable for scenarios with a large number of candidate intents and resulting in low efficiency in intent recognition.

[0062] To avoid being limited by the maximum length of the input vector, another approach has been proposed in related technologies: constructing a binary classifier. This involves concatenating the text to be identified with a description of the intent and inputting the concatenated text into the binary classifier to determine whether the text matches the intent. However, if there are N candidate intents, N matching operations are required. When N is large, the efficiency is too low and it is not suitable for dialogue systems with high real-time requirements.

[0063] In view of this, the applicant proposes the following technical concept to improve the efficiency of intent recognition:

[0064] Converting the description of candidate intents into sentence vectors shortens their vector length. This allows for a greater number of candidate intents to be concatenated with the word vectors of each word in the text before being fed into the model for recognition, within the model's maximum input vector length limit. This improves the efficiency of intent recognition when dealing with a large number of candidate intents. Furthermore, even with shorter candidate intent vectors, a binary classifier can still be used for one-to-one matching. The shorter vector length further improves the efficiency of a single matching operation, thus enhancing the overall intent recognition efficiency.

[0065] Reference Figure 1 The diagram illustrates a flowchart of a user intent recognition method according to an embodiment of this application. Figure 1 As shown, the specific steps may include:

[0066] Step S101: Obtain the text to be identified, and the description statements of each of the multiple candidate intents.

[0067] In this embodiment, the text to be recognized can be obtained by performing speech recognition on the user's voice. The text to be recognized can be understood as a description of the information of the service currently needed by the user. For example, if the user inputs "I want a refund", then the text to be recognized can also be "I want a refund".

[0068] In practice, due to different language habits of users, the text to be recognized can be different to express the same intention. For example, to express the same intention of refund, the text to be recognized generated by user A can be "I want a refund", while the text to be recognized generated by user B can be "I request a refund". Generally speaking, for an intention, the system will preset a standard description statement. For example, for the intention of refund, the standard description statement can be "I want a refund".

[0069] Candidate intents can be understood as intents that reflect user needs and are pre-stored by the system. The description of a candidate intent can be a standard text that describes the intent. For example, if the candidate intent is "refund", then the description could be "I want a refund".

[0070] In this embodiment, description statements for each of the multiple candidate intents can be obtained, and these description statements for each of the multiple candidate intents can be pre-stored.

[0071] Step S102: Process the description statements of each of the multiple candidate intentions to obtain the sentence vectors corresponding to each of the multiple candidate intentions.

[0072] In this embodiment, the description statement of each candidate intent can be processed. Specifically, the description statement of each candidate intent can be converted into a sentence vector. For example, the description statement can be processed into a sentence vector through a vector model.

[0073] In this embodiment, sentence vectors differ from word vectors, which represent words. Sentence vectors represent sentences (containing multiple words). In practice, a sentence vector can also be understood as a unique vector representing the entire descriptive statement, obtained by transforming the entire descriptive statement at the granular level. For example, if the descriptive statement is "I want a refund," then the sentence vector could be a vector reflecting the entire sentence "I want a refund."

[0074] Because descriptive statements are represented by sentence vectors, the length of a vector representation of a descriptive statement is relatively short.

[0075] Step S103: Concatenate the word vectors corresponding to each word in the text to be identified to obtain the word vector sequence corresponding to the text to be identified.

[0076] In this embodiment, word vectors are a representation of words. Generally, the text to be recognized is composed of multiple words. Therefore, the word vector of each word in the text to be recognized can be determined, and then the word vectors of multiple words in the text to be recognized are concatenated to obtain a word vector sequence. Since a text to be recognized generally includes multiple words, the length of the word vector sequence obtained by concatenating the word vectors of multiple words is relatively long compared to sentence vectors. This word vector sequence can reflect the information of the text to be recognized at the granularity of words, thus reflecting the information of the text to be recognized more precisely, thereby enhancing the information expression of the text to be recognized.

[0077] Since the descriptive statements are represented by sentence vectors, while the text to be identified is represented by a sequence of word vectors, the length of the vector representation corresponding to the candidate intent can be shorter than the length of the vector representation corresponding to the text to be identified. This way, when the word vector sequence is subsequently concatenated with the sentence vector, the proportion of the word vector sequence in the concatenated vector is increased, thus allowing the information in the text to be identified to be highlighted as much as possible.

[0078] Step S104: Based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the multiple candidate intentions, determine the user intention that matches the text to be identified from the multiple candidate intentions.

[0079] In this embodiment, after obtaining the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the multiple candidate intentions, the candidate intentions matched by the text to be identified can be determined based on the word vector sequence and the sentence vectors corresponding to each candidate intention.

[0080] In practice, it is possible to determine whether a candidate intent matches the text to be identified based on the sentence vector and word vector sequence corresponding to each candidate intent, which is the recognition method of a binary classifier. Alternatively, the sentence vector and word vector sequence corresponding to multiple candidate intents can be concatenated to determine the candidate intent that matches the text to be identified from multiple candidate intents at once, which is the recognition method of an N-classifier.

[0081] Regardless of the matching method used, the shorter vector representations corresponding to candidate intents at least improve the efficiency of matching and recognition, meeting real-time requirements. Furthermore, when concatenating the word vector representations of each word in the text to be recognized before feeding them into the model for recognition, the number of candidate intents that can be concatenated at one time can be increased within the model's maximum input length limit. This makes it suitable for scenarios with a large number of candidate intents, thereby improving the efficiency of intent recognition.

[0082] On the other hand, since the text to be recognized is processed into a sequence of word vectors (the length of the word vector sequence is greater than that of the sentence vector), the length ratio of the vector of the text to be recognized in the concatenated vector is increased, and the ratio of the word vector sequence in the concatenated vector is also increased. This allows the information of the text to be recognized to be highlighted as much as possible, thereby improving the accuracy of intent recognition.

[0083] Accordingly, in one embodiment, a specific implementation method is provided that concatenates the sentence vectors and word vector sequences corresponding to multiple candidate intents to determine the intent that matches the text to be identified from multiple candidate intents at once, namely, two specific N-classifier identification methods.

[0084] In order to determine the user intent that matches the text to be identified from multiple candidate intents, this application provides two intent recognition models to determine the user intent that matches the text to be identified.

[0085] The first model: the first intent recognition model. Specifically, the first intent recognition model is obtained in the following way:

[0086] The model is trained using multiple concatenated vector samples carrying labels as training samples.

[0087] The concatenated vector sample is formed by concatenating the word vector sequence corresponding to the sample text and the sentence vectors corresponding to multiple sample candidate intentions. The label is used to represent the intention that matches the concatenated vector sample.

[0088] In this embodiment, the sample text can refer to the text input by multiple users during the historical process of collection, and the sample candidate intent can be a descriptive statement of the candidate intent as a sample; the label can represent the candidate intent that matches the concatenated vector sample, specifically, it can be a sentence vector that matches the word vector sequence in the concatenated vector sample, and then it can represent the sample candidate intent that matches the sample text.

[0089] In practice, the label can be an identifier of the sample candidate intent that matches the sample text. For example, if there are N sample candidate intents with identifiers from 1 to N, the label can be 5, which indicates that the sample candidate intent with identifier 5 is the sample candidate intent that matches the sample text.

[0090] The second preset model can be a BERT model. When training the second preset model, it can take concatenated vector samples as input. The output of the second preset model is the probability of the sentence vector matching the sample text, for example, output in the form of CLS placeholders. This yields the candidate intents of the samples matching the sample text. Furthermore, based on the candidate intents and labels output by the second preset model, the loss of the second preset model is determined. The parameters of the second preset model are then updated based on this loss. After the second preset model converges or is updated a preset number of times, the updated second preset model is used as the first intent recognition model.

[0091] After obtaining the first intent recognition model, the word vector sequence corresponding to the text to be recognized and the sentence vectors corresponding to each of the multiple candidate intents can be concatenated to obtain the first concatenated vector; the first concatenated vector is input into the first intent recognition model to obtain the user intent that matches the text to be recognized, output by the first intent recognition model.

[0092] In this embodiment, after obtaining the first intent recognition model, intent recognition can be performed using the first intent recognition model. Specifically, the word vector sequence corresponding to the text to be recognized and the sentence vectors corresponding to multiple candidate intents can be concatenated to obtain a first concatenated vector. During concatenation, the word vector sequence and multiple sentence vectors can be concatenated end to end sequentially to obtain a long vector representation. The word vector sequence and sentence vectors are separated by a first delimiter, while different sentence vectors are separated by a second delimiter.

[0093] After obtaining the first concatenated vector, the first concatenated vector can be input into the first intent recognition model, thereby obtaining the user intent output by the first intent recognition model that matches the text to be recognized.

[0094] The second model: the second intent recognition model, specifically, is obtained through the following method:

[0095] The model was trained using multiple concatenated vector samples carrying dual labels as training data.

[0096] The concatenated vector sample is formed by concatenating the word vector sequence corresponding to the sample text and the sentence vectors corresponding to each of the multiple sample candidate intentions; one of the dual labels is a classification label used to characterize the intention that matches the concatenated vector sample, and the other matching label is used to characterize whether the sentence vectors corresponding to each of the multiple sample candidate intentions match the word vector sequence corresponding to the sample text.

[0097] In this embodiment, the sample text can refer to the text input by multiple users during the collected historical process, and the sample candidate intent can be a descriptive statement of the candidate intent as a sample. The label in this embodiment is a dual label, which can be understood as having two types of labels: a classification label and a matching label. The classification label can represent the candidate intent that matches the concatenated vector sample; specifically, it can represent the sentence vector that matches the word vector sequence in the concatenated vector sample, and thus represent the sample candidate intent that matches the sample text. The matching label can represent whether the word vector sequence of the sample text matches the sentence vector corresponding to each sample candidate intent.

[0098] In practice, the classification label can be an identifier of the sample candidate intent that matches the sample text. For example, if there are N sample candidate intents with identifiers from 1 to N, the classification label can be 5, which indicates that the sample candidate intent with identifier 5 is a sample candidate intent that matches the sample text.

[0099] The matching label can be a number, either 0 or 1. For example, 1 represents a match between the word vector sequence of the sample text and the sentence vector corresponding to the candidate intent, while 0 represents a mismatch. It's understood that the number of matching labels is the same as the number of sample candidate intents; that is, each sample candidate intent corresponds to one matching label.

[0100] The third pre-defined model can be a BERT model, where concatenated vector samples can be used as input during training. Specifically, refer to... Figure 2 As shown, this illustrates a schematic diagram of training a third pre-defined model using concatenated vector samples. Figure 2 As shown, there are L candidate intents, where CLS is the classification label and CLS-1 to CLS-L are the matching labels. The input is a concatenated vector sample, which includes the word vector sequence of the concatenated sample text and the sentence vector corresponding to the candidate intent. Here, f(y1) to f(yL) are the sentence vectors corresponding to the L candidate intents respectively.

[0101] Reference Figure 3 , Figure 3 The flowchart illustrates the steps involved in training the second intent recognition model, which may specifically include the following steps:

[0102] Step S301: Input the multiple spliced ​​vector samples carrying dual labels into the third preset model.

[0103] In this embodiment, multiple concatenated vector samples carrying dual labels can be input into the third preset model. Specifically, multiple concatenated vector samples can be input at once, or one concatenated vector sample can be input at once, so as to train the third preset model in batches.

[0104] Step S302: Obtain the classification prediction result and matching prediction result output by the third preset model.

[0105] In this embodiment, after inputting the spliced ​​vector sample, the third preset model outputs the classification prediction result and the matching prediction result.

[0106] The classification prediction result is used to characterize the intent matching the concatenated vector sample, which further represents the sentence vector matching the word vector sequence in the concatenated vector sample, and thus can characterize the sample candidate intent matching the sample text. The matching prediction result is used to characterize whether the sentence vector corresponding to each of the multiple sample candidate intents matches the word vector sequence corresponding to the sample text.

[0107] Step S303: Determine the classification loss based on the classification prediction result and the classification label, and determine the matching loss based on the matching prediction result and the matching label.

[0108] In this embodiment, the classification loss can be determined based on the classification prediction result and the classification label. The classification loss can characterize the difference between the classification prediction result output by the third preset model and the actual classification result. Furthermore, the classification loss can be understood as the gap between the sample candidate intent to which the sample text predicted by the third preset model belongs and its actual sample candidate intent.

[0109] The matching loss can be determined based on the matching prediction results and the matching tags. The matching loss can reflect the difference between the matching probability of the sample text output by the third preset model and each sample candidate intent and the actual matching probability. For example, if there are L sample candidate intents, the third preset model will predict L matching probabilities, and the matching loss can reflect the difference between the L matching probabilities and the corresponding actual matching probabilities.

[0110] In one embodiment, since the matching prediction result can include matching probabilities corresponding to each of the multiple candidate intentions (i.e., multiple matching probabilities), and the matching label can also include matching labels corresponding to each of the multiple candidate intentions (i.e., multiple matching labels), for each candidate intention, a sub-matching loss can be determined based on the matching probability and matching label corresponding to that candidate intention, thus resulting in multiple sub-matching losses. In practice, the sum of the multiple sub-matching losses can be determined as the final matching loss.

[0111] Step S304: Update the third preset model based on the classification loss and the matching loss.

[0112] In this embodiment, when updating the third preset model, the third preset model can be updated based on the sum of the classification loss and the matching loss.

[0113] In one embodiment, the classification loss and the matching loss can be fused according to the weights corresponding to the classification loss and the matching loss to obtain an overall loss; and the third preset model can be updated according to the overall loss.

[0114] The weights corresponding to the classification loss and the matching loss can be preset according to the actual situation. When fusing the classification loss and the matching loss, the classification loss and the matching loss can be weighted and summed according to the weights corresponding to the classification loss and the matching loss to obtain the overall loss. For example, if the weight corresponding to the classification loss is w, then the weight corresponding to the matching loss is (1-w). Assuming the classification loss is L_c, the matching loss is the sum of the sub-matching losses, which is L_1+L-2+…+L_M; the overall loss is L, then L=w*(L_c)+(1-w)(L_1+L-2+…+L_M).

[0115] Step S305: Determine the third preset model obtained after multiple updates as the second intent recognition model.

[0116] In this embodiment, after the third preset model converges or is updated to the preset number of times, the updated third preset model is used as the second intent recognition model.

[0117] After obtaining the second intent recognition model, the word vector sequence corresponding to the text to be recognized and the sentence vectors corresponding to multiple candidate intents can be concatenated to obtain the second concatenated vector; and the second concatenated vector is input into the second intent recognition model to obtain the user intent that matches the text to be recognized, output by the second intent recognition model.

[0118] Since the second intent model outputs classification prediction results and matching prediction results, after inputting the second concatenation vector into the second intent model, the result can be classification prediction results and matching prediction results. The classification prediction result is the candidate intent that matches the text to be identified, while the matching prediction result is the matching probability between each candidate intent and the text to be identified. The candidate intent with the highest matching probability is the one that matches the text to be identified.

[0119] In practice, the user intent matching the text to be identified can be determined based on the classification prediction results and the matching prediction results. Specifically, if the candidate intent matched by the text to be identified as represented by the classification prediction results is the same as the candidate intent with the highest matching probability in the matching prediction results, then that candidate intent can be taken as the user intent matching the text to be identified. If the two do not correspond to the same candidate intent, then either the candidate intent matched in the classification prediction results or the candidate intent with the highest matching probability in the matching prediction results can be taken as the user intent matching the text to be identified.

[0120] Of course, when training the third preset model, we can try to make the matching prediction result and the classification prediction result as close as possible, that is, try to get the same matching result. In this way, the accuracy of the second intent recognition model in performing intent recognition can be improved.

[0121] Below, in one embodiment of this application, two methods are provided for obtaining the sentence vectors corresponding to each candidate intent:

[0122] Method 1: Input the description statements of each of the multiple candidate intentions into a pre-trained vector transformation model to obtain the sentence vectors corresponding to each of the multiple candidate intentions;

[0123] The vector conversion model is obtained by training a first preset model using the description statements corresponding to the intentions of multiple samples as training data.

[0124] In one embodiment, the vector transformation model can be a bidirectional LSTM model. The candidate intent description is fed into the bidirectional LSTM model, and the last hidden states of the forward and backward networks are concatenated to form a sentence vector. The process of training the vector transformation model can be referenced from relevant techniques and will not be elaborated upon here.

[0125] Method 2: For each candidate intent's description statement, obtain the word vectors corresponding to each word in the description statement of the candidate intent; and compress the multiple word vectors obtained into one vector to obtain the sentence vector corresponding to the candidate intent.

[0126] In one embodiment, since a sentence vector is a representation of a complete sentence, and a complete sentence can include multiple words, for each candidate intent description statement, the word vectors corresponding to each word in the candidate intent description statement can be obtained first, and then the multiple word vectors can be encoded and compressed into a single vector to obtain a sentence vector.

[0127] The method for obtaining the word vectors corresponding to each word in the description can be found in relevant technologies and will not be elaborated here.

[0128] The technical solution adopted in this application has the following main advantages:

[0129] First, it can adapt to intent recognition scenarios with a large number of candidate intents.

[0130] By processing the text to be recognized into a sequence of word vectors and processing the descriptions of multiple candidate intents into a single sentence vector, the length of the candidate intent vector is shortened. This, in turn, shortens the length of the concatenated vector of the text to be recognized and the vectors of multiple candidate intents, allowing for the concatenation of a larger number of candidate intents and improving the efficiency of intent recognition.

[0131] Second, it can improve the real-time performance of intent recognition.

[0132] By shortening the vector length of the candidate intents, the proportion of each candidate intent in the concatenated vector is reduced. Compared to existing technologies that recognize the same number of candidate intents, this application improves the efficiency of intent recognition due to the shorter vector length of the candidate intents and the relatively smaller data volume. This can meet the real-time requirements in some dialogue scenarios, such as shortening the interval between the user's voice output and the system's response, thereby optimizing the user experience.

[0133] Third, the accuracy of intent recognition can be improved by addressing both the input data level and the model level.

[0134] On the one hand, the information of the text to be recognized in the input concatenated vector is enhanced, thereby improving the recognition accuracy. Specifically, since the text to be recognized is processed into a sequence of word vectors (the length of the word vector sequence is greater than that of the sentence vector), the proportion of the length of the text vector in the concatenated vector is increased. This allows the information of the text to be preserved and represented to the greatest extent, making full use of the information of the text to be recognized for intent recognition, and thus helping to improve the accuracy of intent recognition from the perspective of input data.

[0135] On the other hand, since classification loss and matching loss were used when training the second intent recognition model, the loss was calculated from two dimensions, which made the loss calculation based on more information. This allowed for more accurate updating of the parameters of the third preset model, thereby improving the performance of the obtained second intent recognition model and thus helping to improve the accuracy of intent recognition at the model level.

[0136] Based on the same inventive concept as the above embodiments, a second aspect of the present disclosure provides a user intent recognition device, referring to... Figure 4 As shown, a schematic diagram of the structural framework of the user intent recognition device is presented, such as... Figure 4 As shown, it can specifically include the following modules:

[0137] The module 401 is used to obtain the text to be identified, as well as the description statements of each of the multiple candidate intents;

[0138] Processing module 402 is used to process the description statements of each of the multiple candidate intentions to obtain the sentence vectors corresponding to each of the multiple candidate intentions;

[0139] The splicing module 403 is used to splice the word vectors corresponding to each word in the text to be identified to obtain the word vector sequence corresponding to the text to be identified;

[0140] The recognition module 404 is used to determine the user intent that matches the text to be recognized from the multiple candidate intents based on the word vector sequence corresponding to the text to be recognized and the sentence vectors corresponding to each of the multiple candidate intents.

[0141] Optionally, the processing module 402 can be specifically used to input the description statements of each of the multiple candidate intentions into a pre-trained vector conversion model to obtain the sentence vectors corresponding to each of the multiple candidate intentions; wherein, the vector conversion model is obtained by training a first preset model with the description statements corresponding to each of the multiple sample intentions as training data.

[0142] Optionally, the processing module 402 may specifically include the following units:

[0143] The word vector acquisition unit is used to obtain the word vectors corresponding to each word in the description statement of the candidate intent;

[0144] The compression unit is used to compress multiple word vectors into a single vector to obtain the sentence vector corresponding to the candidate intent.

[0145] Optionally, the identification module 404 may specifically include the following units:

[0146] The first concatenation unit is used to concatenate the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to the multiple candidate intentions respectively to obtain the first concatenation vector;

[0147] The first input unit is used to input the first concatenation vector into the first intent recognition model to obtain the user intent output by the first intent recognition model that matches the text to be recognized.

[0148] The first intent recognition model is trained on the second preset model using multiple concatenated vector samples carrying labels as training samples. The concatenated vector samples are formed by concatenating the word vector sequence corresponding to the sample text and the sentence vectors corresponding to the multiple sample candidate intents. The labels are used to represent the intent that matches the concatenated vector samples.

[0149] Optionally, the identification module 404 may specifically include the following units:

[0150] The second splicing unit is used to splice the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to the multiple candidate intentions respectively to obtain the second splicing vector;

[0151] The second input unit is used to input the second concatenation vector into the second intent recognition model to obtain the user intent output by the second intent recognition model that matches the text to be recognized.

[0152] The second intent recognition model is trained on the third preset model using multiple concatenated vector samples carrying dual labels as training data; the concatenated vector samples are formed by concatenating the corresponding word vector sequence of the sample text and the sentence vectors corresponding to each of the multiple sample candidate intents.

[0153] One of the dual labels is a classification label used to characterize the intent to match the concatenated vector sample, and the other is a matching label used to characterize whether the sentence vector corresponding to each of the multiple sample candidate intents matches the word vector sequence corresponding to the sample text.

[0154] Optionally, the device may further include a model training module, specifically used to obtain a second intent recognition model, which may include the following units:

[0155] An input unit is used to input the multiple concatenated vector samples carrying dual labels into the third preset model;

[0156] The result acquisition unit is used to obtain the classification prediction result and the matching prediction result output by the third preset model. The classification prediction result is used to characterize the intention matching the concatenated vector sample, and the matching prediction result is used to characterize whether the sentence vector corresponding to each of the multiple sample candidate intentions matches the word vector sequence corresponding to the sample text.

[0157] The loss determination unit is used to determine the classification loss based on the classification prediction result and the classification label, and to determine the matching loss based on the matching prediction result and the matching label;

[0158] An update unit is used to update the third preset model based on the classification loss and the matching loss;

[0159] The determining unit is used to determine the third preset model obtained after multiple updates as the second intent recognition model.

[0160] Optionally, the update unit may specifically include the following sub-units:

[0161] The first loss determination subunit is used to fuse the classification loss and the matching loss according to the weights corresponding to the classification loss and the matching loss to obtain the overall loss;

[0162] An update subunit is used to update the third preset model based on the overall loss.

[0163] It should be noted that the device embodiments are similar to the method embodiments, so the description is relatively simple. For relevant details, please refer to the method embodiments.

[0164] Based on the same inventive concept as the above embodiments, a third aspect of the present disclosure provides a dialogue system, referring to... Figure 5 As shown, a schematic diagram of the structural framework of the dialogue system is presented, such as... Figure 5 As shown, it can specifically include the following modules:

[0165] It includes a speech recognition module, an intent recognition module, and a dialogue module; among which:

[0166] The speech recognition module is used to recognize the received speech as text.

[0167] The intent recognition module is used to execute the user intent recognition method of this application embodiment to output the user intent that matches the text to be recognized;

[0168] The dialogue module is used to output natural speech based on the user's intent.

[0169] This invention also provides an electronic device that may include a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to perform the user intent recognition method described above.

[0170] This disclosure also provides a non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor, the processor is able to perform an operation to implement the user intent recognition method described above.

[0171] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0172] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0173] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0174] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0175] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0176] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0177] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0178] The foregoing has provided a detailed description of a user intent recognition method, apparatus, dialogue system, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for recognizing user intent, characterized in that, The method includes: Obtain the text to be identified, as well as the description statements of each of the multiple candidate intents; The description statements of each of the multiple candidate intentions are processed to obtain the sentence vectors corresponding to each of the multiple candidate intentions; The word vectors corresponding to each word in the text to be identified are concatenated to obtain the word vector sequence corresponding to the text to be identified. Based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the multiple candidate intentions, the user intention that matches the text to be identified is determined from the multiple candidate intentions; Based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the multiple candidate intents, the user intent matching the text to be identified is determined from the multiple candidate intents, including: The word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to the multiple candidate intentions are concatenated to obtain a second concatenated vector; The second concatenated vector is input into the second intent recognition model to obtain the user intent that matches the text to be recognized, output by the second intent recognition model. The second intent recognition model is trained on the third preset model using multiple concatenated vector samples carrying dual labels as training data; the concatenated vector samples are formed by concatenating the corresponding word vector sequence of the sample text and the sentence vectors corresponding to each of the multiple sample candidate intents. One of the dual labels is a classification label used to characterize the intent to match the concatenated vector sample, and the other is a matching label used to characterize whether the sentence vector corresponding to each of the multiple sample candidate intents matches the word vector sequence corresponding to the sample text.

2. The method according to claim 1, characterized in that, The description statements of each of the multiple candidate intents are processed to obtain the sentence vectors corresponding to each of the multiple candidate intents, including: The description statements of each of the multiple candidate intentions are input into a pre-trained vector transformation model to obtain the sentence vectors corresponding to each of the multiple candidate intentions; The vector conversion model is obtained by training a first preset model using the description statements corresponding to the intentions of multiple samples as training data.

3. The method according to claim 1, characterized in that, The description statements of each of the multiple candidate intents are processed to obtain the sentence vectors corresponding to each of the multiple candidate intents, including: For each candidate intent description, perform the following steps: Obtain the word vectors corresponding to each word in the description of the candidate intent; The multiple word vectors obtained are compressed into a single vector to obtain the sentence vector corresponding to the candidate intent.

4. The method according to claim 1, characterized in that, Based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the multiple candidate intents, the user intent matching the text to be identified is determined from the multiple candidate intents, including: The word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to the multiple candidate intentions are concatenated to obtain the first concatenated vector; The first concatenated vector is input into the first intent recognition model to obtain the user intent that matches the text to be recognized, output by the first intent recognition model. The first intent recognition model is trained on the second preset model using multiple concatenated vector samples carrying labels as training samples. The concatenated vector samples are formed by concatenating the word vector sequence corresponding to the sample text and the sentence vectors corresponding to the multiple sample candidate intents. The labels are used to represent the intent that matches the concatenated vector samples.

5. The method according to claim 1, characterized in that, The second intent recognition model is obtained through the following steps: The multiple concatenated vector samples carrying dual labels are input into the third preset model; Obtain the classification prediction result and matching prediction result output by the third preset model, wherein the classification prediction result is used to characterize the intent matching the concatenated vector sample, and the matching prediction result is used to characterize whether the sentence vector corresponding to each of the multiple sample candidate intents matches the word vector sequence corresponding to the sample text; Based on the classification prediction result and the classification label, determine the classification loss, and based on the matching prediction result and the matching label, determine the matching loss; The third preset model is updated based on the classification loss and the matching loss; The third preset model obtained after multiple updates is determined as the second intent recognition model.

6. The method according to claim 5, characterized in that, The third preset model is updated based on the classification loss and the matching loss, including: Based on the weights corresponding to the classification loss and the matching loss, the classification loss and the matching loss are fused to obtain the overall loss; The third preset model is updated based on the overall loss.

7. A user intent recognition device, characterized in that, The device includes: The acquisition module is used to acquire the text to be identified, as well as the description statements of each of the multiple candidate intents; The processing module is used to process the description statements of each of the multiple candidate intents to obtain the sentence vectors corresponding to each of the multiple candidate intents; The concatenation module is used to concatenate the word vectors corresponding to each word in the text to be identified, so as to obtain the word vector sequence corresponding to the text to be identified; The recognition module is used to determine the user intent that matches the text to be recognized from the multiple candidate intents based on the word vector sequence corresponding to the text to be recognized and the sentence vectors corresponding to each of the multiple candidate intents; Based on the word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to each of the multiple candidate intents, the user intent matching the text to be identified is determined from the multiple candidate intents, including: The word vector sequence corresponding to the text to be identified and the sentence vectors corresponding to the multiple candidate intentions are concatenated to obtain a second concatenated vector; The second concatenated vector is input into the second intent recognition model to obtain the user intent that matches the text to be recognized, output by the second intent recognition model. The second intent recognition model is trained on the third preset model using multiple concatenated vector samples carrying dual labels as training data; the concatenated vector samples are formed by concatenating the corresponding word vector sequence of the sample text and the sentence vectors corresponding to each of the multiple sample candidate intents. One of the dual labels is a classification label used to characterize the intent to match the concatenated vector sample, and the other is a matching label used to characterize whether the sentence vector corresponding to each of the multiple sample candidate intents matches the word vector sequence corresponding to the sample text.

8. A dialogue system, characterized in that, It includes a speech recognition module, an intent recognition module, and a dialogue module; among which: The speech recognition module is used to recognize the received speech as text. The intent recognition module is used to execute claim 1 The user intent recognition method according to any one of the six claims is used to output a user intent that matches the text to be recognized; The dialogue module is used to output natural speech based on the user's intent.

9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements claim 1. The user intent recognition method described in any one of the six claims.

10. A computer-readable storage medium, characterized in that, Its stored computer program causes the processor to execute as claimed in claim 1. The user intent recognition method described in any one of the six claims.