Intention recognition method and device

By segmenting long dialogue text into multiple fragments and using the Transformer-XL model for encoding and decoding, the accuracy problem of intent recognition in long dialogue scenarios is solved, achieving more efficient user intent prediction.

CN115269836BActive Publication Date: 2025-11-25BEIJING FLYING ELEPHANT PLANET TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210843393.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-18
Publication Date
2025-11-25
Estimated Expiration
2042-07-18

AI Technical Summary

Technical Problem

Existing pre-trained language models cannot encode long texts in one go in long dialogue scenarios, resulting in low training efficiency and inaccurate prediction results, and failing to accurately predict user intent.

Method used

The long dialogue text is segmented into multiple text fragments, each of which is encoded using the Transformer-XL model. Extended information is then fused through a recursive mechanism, and intent recognition is performed using encoding and decoding units.

Benefits of technology

It improves the accuracy of user intent prediction in long dialogue scenarios, ensuring that the model can capture the semantic information of the entire dialogue text and output a more accurate intent category probability distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269836B_ABST
    Figure CN115269836B_ABST
Patent Text Reader

Abstract

The application provides an intention recognition method and device, wherein the intention recognition method comprises: obtaining target dialogue text, and cutting the target dialogue text into at least two text segments; inputting the at least two text segments into an intention recognition model, wherein the intention recognition model comprises an encoding unit and a decoding unit; sequentially performing encoding processing on the at least two text segments by the encoding unit to obtain an encoding vector, wherein the encoding vector is composed of encoding sub-vectors obtained by each text segment fusing and expanding information; performing decoding processing on the encoding vector by the decoding unit to obtain an intention category probability distribution corresponding to the target dialogue text and output the intention recognition model. By sequentially processing each text segment by using the intention recognition model, each text segment fuses and expands information and then is subjected to encoding processing, the purpose of expanding context is achieved, the semantic information of the whole target dialogue text can be better captured, and therefore the accuracy of user intention prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to an intent recognition method. The present application also relates to an intent recognition device, a computing device, and a computer-readable storage medium. BACKGROUND

[0002] With the development of artificial neural network technology, the construction and training of artificial neural networks can solve the expression problem of relatively complex logical strategies. Currently, a pre-trained language model can be used for a text classification task, for example, predicting a user intention based on a user dialogue using a pre-trained language model, so as to determine whether the user will churn. However, the pre-trained language model cannot encode a long dialogue at one time in a dialogue scenario, resulting in low model training efficiency and inaccurate prediction results. Therefore, how to accurately predict the user intention in a long dialogue scenario is a problem that needs to be solved at present. SUMMARY

[0003] Therefore, the embodiments of the present application provide an intent recognition method, which accurately predicts the user intention based on a long dialogue text, so as to provide corresponding services for the user and improve user satisfaction. The present application also relates to an intent recognition device, a computing device, and a computer-readable storage medium to solve the problem that the user intention cannot be accurately predicted in a long dialogue scenario in the prior art.

[0004] According to a first aspect of the embodiments of the present application, an intent recognition method is provided, which includes:

[0005] obtaining a target dialogue text, and dividing the target dialogue text into at least two text segments;

[0006] inputting the at least two text segments into an intent recognition model, wherein the intent recognition model includes an encoding unit and a decoding unit;

[0007] performing encoding processing on the at least two text segments in sequence by the encoding unit to obtain an encoding vector, wherein the encoding vector is composed of encoding sub-vectors obtained by each text segment fusing and expanding information coding;

[0008] performing decoding processing on the encoding vector by the decoding unit to obtain an intent category probability distribution corresponding to the target dialogue text and output the intent recognition model.

[0009] According to a second aspect of the embodiments of the present application, an intent recognition device is provided, which includes:

[0010] a division module configured to obtain a target dialogue text, and divide the target dialogue text into at least two text segments;

[0011] The input module is configured to input the at least two text segments into an intent recognition model, wherein the intent recognition model comprises an encoding unit and a decoding unit.

[0012] The encoding module is configured to sequentially perform encoding processing on the at least two text segments by the encoding unit to obtain an encoding vector, wherein the encoding vector is composed of encoding sub-vectors obtained by each text segment fusing and expanding information coding.

[0013] The decoding module is configured to perform decoding processing on the encoding vector by the decoding unit to obtain an intent category probability distribution corresponding to the target dialogue text and output the intent recognition model.

[0014] According to a third aspect of the embodiments of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the computer instructions to implement the steps of the intent recognition method.

[0015] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer instructions executable by a processor to implement the steps of the intent recognition method.

[0016] The intent recognition method provided by the present application obtains a target dialogue text, and splits the target dialogue text into at least two text segments; inputs the at least two text segments into an intent recognition model, wherein the intent recognition model comprises an encoding unit and a decoding unit; sequentially performs encoding processing on the at least two text segments by the encoding unit to obtain an encoding vector, wherein the encoding vector is composed of encoding sub-vectors obtained by each text segment fusing and expanding information coding; performs decoding processing on the encoding vector by the decoding unit to obtain an intent category probability distribution corresponding to the target dialogue text and output the intent recognition model.

[0017] An embodiment of the present application realizes that the target dialogue text is split into multiple text segments, each text segment is fused with expansion information and then encoded by using an intent recognition model, the purpose of expanding context is achieved, the semantic information of the whole target dialogue text can be better captured, and thus the accuracy of user intent prediction is improved. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 is a structural schematic diagram of an intent recognition method provided by an embodiment of the present application;

[0019] Figure 2 is a flowchart of an intent recognition method provided by an embodiment of the present application;

[0020] Figure 3 is a segmentation schematic diagram of target dialogue text in an embodiment of the present application;

[0021] Figure 4 is a processing flowchart of an intent recognition method applied to a course continuation reporting intent recognition provided by an embodiment of the present application;

[0022] Figure 5 is a structural schematic diagram of an intent recognition apparatus provided by an embodiment of the present application;

[0023] Figure 6 is a structural block diagram of a computing device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0024] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be practiced without the specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to obscure the present application. Some portions of the detailed description which follow are presented in terms of algorithms, symbolic representations of operations on data bits or binary digital signals stored within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art.

[0025] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present application. As used in one or more embodiments of the present application and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0026] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another only. For example, a first can be termed a second, and, similarly, a second can be also termed a first, without departing from the scope of one or more embodiments of the present application. As used herein, the term "if' can be construed to mean "when" or "in response to determining" or "in response to a determination" or "in response to the fact that...."

[0027] First, the noun terms related to one or more embodiments of the present application are explained.

[0028] Intention prediction: The intention prediction task, i.e., intent recognition, is to identify the user's intention category according to a call record, for example, to identify the satisfaction of parents on the teaching level of teachers according to the dialogue between teachers and parents.

[0029] Text classification: Text classification is a classic task in natural language processing, which involves assigning text to its corresponding category based on certain classification system or criteria. Given labeled data, a neural network model can be trained to predict the category of a text.

[0030] BERT: Bidirectional Encoder Representation from Transformers is a pre-trained language representation model for natural language processing, which can obtain vector representation of text by encoding bidirectional information of text.

[0031] XLNet: XLNet based on transformer-XL is a model that has made significant changes based on BERT. In the context of long text, XLNet has better performance than other BERT models.

[0032] With the development of information technology, data mining has attracted the attention of the information industry. Through data mining, useful information can be obtained from a large amount of data. For example, in the sales scenario, if the purchase intention or preference of customers for goods can be mined from the conversation between sales personnel and customers, sales personnel can provide relevant information to customers, so that customers can more clearly obtain information about their favorite goods, and improve customer satisfaction. Traditionally, the purchase intention of customers can only be judged by the subjective judgment of sales personnel, and the difference in judgment results is large and the accuracy is low, and there is no objective data to support it, so it is difficult to collect effective data. To this end, the existing technology proposes to use a neural network model to predict the intention category, thereby improving the prediction accuracy of the customer intention category. Intention prediction can be regarded as a text classification task. For a piece of text, input it into a BERT model to obtain the vector representation of the text, and then calculate the probability of each category through a neural network. The category with the highest probability is taken as the category of the text.

[0033] However, in this method, when modeling language, the existing technology proposes an effective encoder to improve the ability of the encoder to capture long-distance dependencies. LSTM uses a gating mechanism and gradient clipping to model long-distance dependencies, and research has shown that the maximum average distance that can be encoded is about 200. Transformer uses a self-attention mechanism, which allows words to be directly connected, and can better capture long-distance dependencies, and its encoding ability exceeds LSTM, but it is limited to fixed-length context. The maximum input length of the BERT model based on Transformer is 512, and in the dialogue scenario, the total number of words can be up to 4000, and BERT cannot encode it at once.

[0034] In a dialogue scenario, usually the first 512 characters and the last 512 characters are intercepted and then input into the trained BERT model. Such a method is suitable for news and encyclopedia documents because the classification information of these documents is mainly distributed at the beginning and end of the text. However, in a long dialogue scenario, the dialogue scenario has a large number of characters, and the classification information can be distributed anywhere in the entire conversation. Therefore, it is impossible to perform text classification by simply intercepting the beginning and end of the conversation.

[0035] Based on this, in the present application, an intent recognition method is provided for accurately predicting the intent in a long dialogue scenario, solving the problem that the prior art cannot accurately classify long text. The present application also relates to an intent recognition device, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments.

[0036] Figure 1 FIG. 1 is a structural schematic diagram of an intent recognition method according to an embodiment of the present application. The target dialogue text, i.e., the long dialogue text, can be understood as the dialogue text between the staff and the customer. The long dialogue text can be obtained by converting the dialogue record into text through speech. In actual application, the staff can input the dialogue record, such as telephone recording, chat record, etc. to the intent recognition model. The intent recognition model outputs the corresponding intent category probability distribution after processing, thereby determining the user's intent. The staff can provide personalized services for the user according to the user's intent.

[0037] Further, taking the communication record between the teacher and the parent as an example, the teacher visits the parents after class and asks about the parents' satisfaction with the course. After the communication, the teacher can convert the telephone communication record into dialogue text and input it into the intent recognition model. The output result of the intent recognition model is "satisfaction: high". The teacher can understand the parents' evaluation of the teacher's teaching according to the user's intent, and can also provide other courses of the teacher for the parents to improve the user's satisfaction.

[0038] Specifically, Figure 2 FIG. 2 shows a flowchart of an intent recognition method according to an embodiment of the present application, which specifically includes the following steps:

[0039] Step 202: Obtain the target dialogue text and divide the target dialogue text into at least two text segments.

[0040] The target dialogue text can be understood as the text of the dialogue content between two speakers, that is, the dialogue text for which the user intent needs to be predicted. The target dialogue text can be directly derived from the text generated in the communication process between the speakers, can be obtained by inputting the speech data generated in the communication process into a speech recognition model to obtain the dialogue text output by the speech recognition model, or can be obtained by recognizing the pictures and videos containing the dialogue text through an optical character recognition (OCR) technology. The application does not make a specific limitation on the acquisition method of the target dialogue text.

[0041] In actual application, in order to better enable the model to predict correct results, for long dialogue text, the model should be used to encode the entire sequence of the long dialogue text. However, considering the computing resources and memory problems, this scheme is not feasible. Therefore, in the embodiment of the application, the target dialogue text is divided into multiple text segments, as shown in Figure 3 Figure 3 is a division schematic diagram of the target dialogue text in an embodiment of the application, wherein the target dialogue text is divided according to a division rule with a length of 4. Subsequently, each text segment is encoded to obtain an accurate prediction result.

[0042] In an embodiment of the application, the target dialogue text is obtained by speech recognition from a communication telephone recording between a teacher and a parent, and the target dialogue text is used to provide a data basis for identifying the satisfaction of the parent with the course. The target dialogue text is divided into multiple divided text segments with a length of 4.

[0043] In a dialogue scenario, the total number of dialogue text is large, so that the model cannot be encoded according to the entire dialogue text. In the embodiment of the application, for long dialogue text, first, the division processing is performed to obtain multiple text segments, and then the obtained multiple text segments are input into an intent recognition model. The recursive mechanism is introduced into the intent recognition model, so that there is no context fragment problem between the text segments, and the prediction result output by the intent recognition model is ensured to be accurate.

[0044] In actual application, there is some invalid information, such as tone words, noise and the like, in the dialogue record between the speakers, or there is no valid information in the entire dialogue record. The dialogue text converted from this kind of dialogue record cannot be subjected to intent recognition. Therefore, when the target dialogue text is acquired, the dialogue record can be subjected to data cleaning first to obtain valid dialogue text, so that the subsequent intent recognition model can recognize the corresponding user intent category according to the valid dialogue text. Specifically, the target dialogue text is acquired, including:

[0045] A dialogue information set associated with the target business is acquired.​

[0046] perform data cleaning on initial dialogue information included in the dialogue information set to obtain a target dialogue information set including target dialogue information;

[0047] determine at least two dialogue texts corresponding to the target dialogue information in the target dialogue information set, and obtain the target dialogue text by splicing the at least two dialogue texts, wherein each of the at least two dialogue texts includes a speaker identifier.

[0048] The dialogue information set can be understood as a communication record between speakers, and the dialogue information set includes dialogue information corresponding to different speakers. The dialogue information set associated with the target business can be understood as a dialogue information set related to the target business. For example, the target business is a tutorial class registration business, and the dialogue information set associated with the target business includes dialogue information between a teacher and a parent about registering for a tutorial class.

[0049] Specifically, the target business specifically refers to a business item that a user can participate in and can provide corresponding services to the user, and the target business also involves interaction between an operator and the user, which is used to assist the target business to provide more high-quality business services to the user and reach more users. Correspondingly, the dialogue information set specifically refers to a set composed of dialogue information between an operator and a user associated with the target business. Correspondingly, the initial dialogue information specifically refers to dialogue information in the dialogue information set that has not been processed, including non-standardized text content, such as mood adverbs, repeated word units, and missing word units. Correspondingly, data cleaning specifically refers to filtering and / or standardizing the initial dialogue information, which is used to remove unclearly expressed content in the initial dialogue information, convert spoken language content into written language content, remove initial dialogue information that does not meet business requirements, and the like, to ensure that the target dialogue information included in the target dialogue information set meets the subsequent model training requirements. Correspondingly, the dialogue text specifically refers to the speech content corresponding to any one speaker involved in the dialogue information, that is, each dialogue text corresponds to a speaker, and each dialogue text includes a speaker identifier. The speaker identifier specifically refers to an identifier representing a speaker, which can be a character identifier, a string identifier, and the like, which are not limited in this embodiment.

[0050] In practical applications, since the initial dialogue information in the dialogue information set may include some invalid information and noise, it is necessary to perform data cleaning on the initial dialogue information to obtain a target dialogue information set containing target dialogue information. For example, in an actual scenario, when a teacher asks parents through a telephone whether to continue to enroll in a tutoring class in the next semester, the dialogue information set may include some dialogue information of unconnected telephone calls such as busy tone and power-off. Therefore, such dialogue information should be removed. Specifically, the cleaning rules for data cleaning on the initial dialogue information can include the following points:

[0051] 1. Filtering unconnected telephone calls such as busy tone, power-off, and no signal. In this case, since no effective dialogue record is generated between speakers, such dialogue information needs to be cleaned.

[0052] 2. Filtering dialogue with short conversation content. For example, a rule of filtering dialogue with a total number of sentences less than 20, dialogue information with a total number of sentences less than 20 is removed. Although such dialogue information contains dialogue records between speakers, since the content is short, it cannot be converted into effective dialogue text for subsequent prediction by the model.

[0053] 3. Filtering dialogue that may have identity annotation errors. For example, filtering dialogue in which any one person speaks more than 15 sentences in succession; filtering dialogue in which only one person speaks throughout the entire dialogue. This data cleaning rule filters dialogue in which the speaker is only the teacher and the content that can represent the user's intention is little.

[0054] 4. Deleting meaningless characters such as adverbs. In subsequent intent recognition, only the speech content of the speaker is processed, so it is necessary to filter out adverbs in the dialogue information that are irrelevant to the dialogue content.

[0055] 5. Supplementing a period at the end of a sentence that does not end with a punctuation mark. The purpose of this data cleaning rule is to accurately distinguish each sentence so that the identity of the speaker can be determined subsequently.

[0056] 6. Correcting the identity of the speaker. The identity of the speaker is extracted at the beginning of the dialogue information using a regular expression as the identity of the speaker for each sentence. For example, in the first three sentences of the teacher and the parent, search according to the following regular expression: “I am.{1,10} teacher | this side is.{1,10} teacher | is.{1,5} parent?”, if the search condition is met, the speaker is determined to be a teacher, and if neither of the two speakers meets the condition, the person with the most words is determined to be the teacher.

[0057] 7. Splicing dialogue. Multiple sentences of dialogue of two speakers are spliced into a long string.

[0058] By the data cleaning rule provided above, some noise information in the dialogue information can be filtered, and a target dialogue information set containing target dialogue information is obtained. According to the data cleaning rule, at least two dialogue texts corresponding to the target dialogue information in the target dialogue information set can also be spliced. The two dialogue texts can be understood as the speech content of two speakers respectively. After splicing, a target dialogue text is obtained, which is a long string. Based on this, when it is determined that the intent recognition model needs to be trained for the target business, the dialogue information set associated with the target business can be obtained first, so that the trained intent recognition model can be applied to the prediction in the target business scenario. Further, considering that the initial dialogue information contained in the dialogue information set is not standard, if the model is trained based on this, the prediction accuracy of the model may be reduced. Therefore, before the model is trained, the initial dialogue information contained in the dialogue information set can be cleaned first to standardize the initial dialogue information, and the initial dialogue information in the dialogue information set that does not meet the requirements of the business scenario can be removed, so that a target dialogue information set containing target dialogue information is obtained according to the processing result.

[0059] Further, after obtaining the target dialogue information set, since each target dialogue information is formed by the dialogue content between at least two users, the intent recognition not only needs to be combined with the speech content of the user participating in the target business, but also needs to consider the speech content of the operator interacting with the user. Based on this, the samples for building the training model can make the prediction accuracy of the model higher. Therefore, at least two dialogue texts contained in each target dialogue information can be spliced to obtain a plurality of target dialogue texts according to the splicing result, and the speaker identifier of each user is also contained in the target dialogue text, which facilitates subsequent training of the model based on the speaker identifier and the text content.

[0060] In practical applications, considering that the data cleaning stage will be completed in combination with a plurality of cleaning rules set by the target business, and different cleaning rules will produce different modifications to the initial dialogue information, therefore, in specific implementation, one or more cleaning rules can be selected to process the initial dialogue information according to the business requirements to achieve the purpose of data cleaning. For example, the cleaning rules include rule A, rule B and rule C. When cleaning the initial dialogue information, rule A can be selected to clean the initial dialogue information, and the cleaned dialogue information is the target dialogue information. Or rule A, rule B and rule C are selected to clean the initial dialogue information, and the initial dialogue information processed by the three rules is the target dialogue information.

[0061] In the target business scenario, the cleaning rules include but are not limited to: rejecting initial dialogue information whose text length does not reach a length threshold, rejecting initial dialogue information whose speaker identification annotation is incorrect, rejecting meaningless characters (such as mood words, etc.) in the initial dialogue information, and repairing punctuation marks for the initial dialogue information. In actual application, the cleaning rules can be set according to actual needs, and the data cleaning stage can be selected according to needs, which is not limited in this embodiment.

[0062] For example, in the online course reporting business scenario, after determining the user's reporting intention, different ways can be used to interface with the user according to different reporting intentions; for example, if the user's reporting intention is strong, the user can be directly recommended to report the course, or if the user's reporting intention is weak, the user can be recommended to try the online course, thereby improving the user's experience of participating in the online course reporting business. Accurate identification of the user's reporting intention is the most important in this process. The user's reporting intention can be identified by using an intention recognition model, and before that, an intention recognition model that meets the current business scenario needs to be trained.

[0063] Further, first, the dialogue information set related to the online course reporting business, i.e., the set of dialogues between the teacher and the user, is obtained; second, considering that the initial dialogue information contained in the dialogue information set may not meet the sample use standard, the initial dialogue information contained in the dialogue information set can be cleaned; the initial dialogue information with short dialogue content in the dialogue information set can be filtered, such as filtering the initial dialogue information with less than 20 total dialogue sentences between the two parties; the initial dialogue information with identity annotation errors can be filtered, such as filtering the initial dialogue information that labels the teacher's words as the user's words; the initial dialogue information in which any one person speaks more than n sentences in a row can be filtered, such as the initial dialogue information in which one person speaks more than 15 sentences in a row; meaningless characters in the initial dialogue information can be deleted, such as deleting the mood adverb "Ai" in the initial dialogue information; the initial dialogue information can be corrected for punctuation marks, such as adding a period after the end of a sentence.

[0064] Further, after the initial dialogue information contained in the dialogue information set is cleaned, a target dialogue information set composed of target dialogue information with clear text expression can be obtained. Thereafter, considering that each target dialogue information is a dialogue between the user and the teacher, in order to be used in the model training stage and to complete intention recognition in combination with the dialogue content of both parties, the dialogue text corresponding to the teacher and the user in each target dialogue text can be spliced to obtain the target dialogue text corresponding to the target dialogue information, which can be used for subsequent model training.

[0065] It should be noted that in the stage of determining the speaker identifier corresponding to each dialogue text, a regular expression search method can be used to determine the user identity to which the starting dialogue text in each initial dialogue information belongs, and then the subsequent dialogue text is marked with the determined user identity statement, so as to determine the speaker identifier corresponding to each dialogue text. For example, user A communicates with user B, the first sentence content of user A is {a1}, the first sentence content of user B is {b1}, and the two users communicate 10 sentences. In the identity determination stage, the first and second sentences can be identified first, and then the first sentence is determined according to the recognition result to determine which user the first sentence corresponds to, and then the remaining 10 sentences are identified according to the speaking characteristics corresponding to the first sentence, so as to determine the speaking content corresponding to user A, and the remaining is the speaking content of user B.

[0066] Alternatively, a regular expression search is used to search the identity of user A and user B. The regular expression search is: I am {1,10} user A | this side is {1,10} user A | is {1,5} a parent? If the search condition is met, it is determined that the corresponding user is user A. If neither of the two people meets the condition, the one with the most speaking content is selected as user A (user A is associated with a target service).

[0067] In actual application, the determination of the speaker identifier can be selected according to actual needs, and can also be realized by using a tone recognition method or a manual marking method. The present embodiment does not make any limitation here.

[0068] It should be noted that the data cleaning rules provided above are only data cleaning rules provided by the embodiments of the present application. In actual application, other data cleaning rules can also be selected according to actual conditions, and the present application does not make specific limitations. In actual implementation, several data cleaning rules can also be selected from the above data cleaning rules for cleaning, so as to avoid resource waste and improve data preprocessing efficiency. Specifically, the initial dialogue information included in the dialogue information set is subjected to data cleaning to obtain a target dialogue information set including target dialogue information, including:

[0069] Determining a data cleaning link including a plurality of data cleaning nodes;

[0070] Selecting a data cleaning rule corresponding to an i-th data cleaning node in the data cleaning link, and performing data cleaning on the initial dialogue information included in the dialogue information set to obtain an initial dialogue information set;

[0071] Determining whether the data cleaning link includes an unexecuted data cleaning node;

[0072] If yes, i is increased by 1, the initial conversation information set is taken as a conversation information set, and the step of selecting the data cleaning rule corresponding to the ith data cleaning node in the data cleaning link is performed;

[0073] If no, the initial conversation information set is taken as a target conversation information set containing target conversation information.

[0074] In the data cleaning stage, the data cleaning link associated with the target business can be determined first, and then the data cleaning rule corresponding to the ith data cleaning node in the link is selected to clean all the initial conversation information in the conversation information set, and the initial conversation information set is obtained according to the cleaning result, wherein i is a positive integer and i starts from 1; thereafter, it is determined whether there is an unexecuted data cleaning node in the data cleaning link, if yes, i is increased by 1, the initial conversation information set is taken as a conversation information set, and the process of selecting the data cleaning rule corresponding to the data cleaning node and cleaning the conversation information set is performed again. Until all the data cleaning nodes in the data cleaning link are executed, the final initial conversation information set is taken as the target conversation information set for subsequent model training.

[0075] Specifically, the data cleaning link specifically refers to a link composed of at least two data cleaning nodes, and the data cleaning nodes have an execution order in the data cleaning link, and different data cleaning nodes correspond to different data cleaning rules. Correspondingly, the data cleaning node specifically refers to a node for cleaning the initial conversation information in the conversation information set. Correspondingly, the data cleaning rule includes but is not limited to eliminating the initial conversation information whose text length does not reach the length threshold, eliminating the initial conversation information whose speaker identification is incorrectly labeled, eliminating meaningless characters (such as mood words) in the initial conversation information, and repairing punctuation marks for the initial conversation information. In actual application, the cleaning rule can be set according to actual needs, and the data cleaning stage can be selected according to needs, which is not limited in this embodiment.

[0076] Based on this, in the data cleaning stage, the data cleaning link associated with the target business can be determined first, and then the data cleaning rule corresponding to the ith data cleaning node in the link is selected to clean all the initial conversation information in the conversation information set, and the initial conversation information set is obtained according to the cleaning result, wherein i is a positive integer and i starts from 1; thereafter, it is determined whether there is an unexecuted data cleaning node in the data cleaning link, if yes, i is increased by 1, the initial conversation information set is taken as a conversation information set, and the process of selecting the data cleaning rule corresponding to the data cleaning node and cleaning the conversation information set is performed again. Until all the data cleaning nodes in the data cleaning link are executed, the final initial conversation information set is taken as the target conversation information set for subsequent model training.

[0077] In actual application, after determining the data cleaning link containing multiple data cleaning nodes, the initial dialogue information set contained in the dialogue information set can be sequentially cleaned according to the data cleaning nodes in the data cleaning link, so as to obtain the initial dialogue information set. The specific logic is that the data cleaning rule corresponding to the i th data cleaning node is selected to clean the dialogue information set, it is judged whether the dialogue information set has been cleaned by other data cleaning nodes in the data cleaning link, if there is a data cleaning node that has not been executed, the next data cleaning node is executed, that is, the data cleaning rule corresponding to the i+1 th data cleaning node is used to clean the dialogue information set.

[0078] It should be noted that the data cleaning rule corresponding to each data cleaning node can refer to the data cleaning process of the above embodiment when cleaning the initial dialogue information, and this embodiment will not be described in detail.

[0079] In summary, by using the data cleaning link to clean the initial dialogue information, it can be ensured that all initial dialogue information contained in the dialogue information set is cleaned, so that the target dialogue information set is more standard, and the intent recognition model with higher prediction accuracy can be trained.

[0080] In an embodiment of the present application, a data cleaning link containing three data cleaning nodes is determined, wherein the data cleaning rule corresponding to the data cleaning node 1 is to filter the unconnected telephone, the data cleaning rule corresponding to the data cleaning node 2 is to filter the dialogue with short call content, and the data cleaning rule corresponding to the data cleaning node 3 is to delete meaningless characters such as adverbs. Then, the data cleaning rule corresponding to the first data cleaning node is selected for the first data cleaning in the data cleaning link, and the initial dialogue information set 1 is obtained. It is judged that the data cleaning node 2 and the data cleaning node 3 in the data cleaning link have not been executed, and the initial dialogue information set 1 obtained after the first data cleaning is selected for the second data cleaning node. The second data information is performed, and the initial dialogue information set 2 obtained after the second data cleaning is obtained. It is continued to be judged that the data cleaning node 3 in the data cleaning link has not been executed, and the initial dialogue information set 2 obtained after the second data cleaning is selected for the third data cleaning node. The third data cleaning is performed, and the initial dialogue information set 3 is obtained. It is judged that there is no data cleaning node in the data cleaning link that has not been executed, and the initial dialogue information set 3 is taken as the target dialogue information set containing the target dialogue information.

[0081] After data cleaning, the target dialogue information set obtained eliminates the redundant noise in the dialogue information set, so that the subsequent model can better process the target dialogue text converted from the target dialogue information set, and output more accurate results.

[0082] Because the total number of words of the target dialogue text is too large, the model cannot encode the entire target dialogue text at one time, so the target dialogue text needs to be segmented, and the model processes the segmented target dialogue text in sequence. Specifically, the target dialogue text is segmented into at least two text segments, including:

[0083] A preset segmentation strategy is obtained, and a segmentation window is determined according to the preset segmentation strategy.

[0084] The target dialogue text is segmented according to the segmentation window to obtain at least two text segments.

[0085] The preset segmentation strategy can be understood as a strategy for segmenting dialogue text set in advance, and the preset segmentation strategy includes segmentation size, segmentation times, and the like. In actual application, after the segmentation window is determined according to the preset segmentation strategy, the target dialogue text can be segmented based on the segmentation window, as shown in FIG. 2B, the segmentation window size is 4, the window is moved to the right after each segmentation and continues to segment, until the end of the target dialogue text is segmented. Figure 3

[0086] In actual implementation, when the segmentation window moves to the end of the dialogue text, the text vector in the last segmented text segment may not meet the segmentation window size. The vector can be supplemented to meet the segmentation window size, or the text vector can be discarded, so that each text segment obtained finally meets the segmentation window size, facilitating subsequent input of the model for processing.

[0087] Step 204: inputting the at least two text segments into an intent recognition model, wherein the intent recognition model includes an encoding unit and a decoding unit.

[0088] The intent recognition model refers to a pre-trained neural network model, and the intent recognition model provided in the embodiment of the present application is an XLNet model. The XLNet model is selected to directly obtain vector representation of long text by using the self-recurrent characteristic, so that the semantic information of the entire text segment can be better captured, and the accuracy of the intent recognition can be improved.

[0089] In actual application, the intent recognition model includes an encoding unit and a decoding unit. The encoding unit is used to obtain a vector sequence by encoding the input dialogue text sequence, and input the vector sequence into the decoding unit. The decoding unit is used to obtain a sequence vector by decoding the input vector sequence, and convert the sequence vector into a probability by normalization processing, and output the model.

[0090] ​In an embodiment of the present application, the plurality of text segments obtained by cutting the target dialogue text are input into the intent recognition model, each text segment is processed by the intent recognition model in turn, and the intent recognition result of the target dialogue text is output.

[0091] Therefore, by selecting the XLNet model as the intent recognition model for training, the XLNet model can also meet the demand of intent recognition in the long dialogue text scenario, and the accurate intent category can be predicted from the long dialogue text.

[0092] The intent recognition model includes an encoding unit and a decoding unit, and the encoding unit and the decoding unit are used for intent recognition processing, so as to output the predicted intent category. Specifically, the model processing process includes steps 206 to 208.

[0093] Step 206: The encoding unit is used to sequentially encode the at least two text segments to obtain an encoding vector, wherein the encoding vector is composed of an encoding sub-vector obtained by fusing and expanding information coding of each text segment.

[0094] The encoding vector can be understood as an encoding vector obtained after encoding all text segments. In actual application, due to the large amount of data of the target dialogue text, the model cannot perform encoding processing on all text sequences at one time, so each text segment can be processed in turn to obtain the respective encoding sub-vector of each text segment, and the encoding vector of the target dialogue text is obtained by splicing.

[0095] In actual application, if each text segment is only encoded separately, all context information will be ignored, resulting in context fragmentation problem. In the long dialogue text scenario, the user's intent may exist at any place. When the context information is ignored, the final prediction result may be incorrect, and the user's intent cannot be correctly predicted, thereby bringing a bad service experience to the user.

[0096] Therefore, the intent recognition model provided in the present application introduces a recursive mechanism in the encoding process, and the corresponding expansion information is fused before the encoding processing of each text segment. The expansion information can be understood as the hidden state sequence obtained by encoding the previous text segment, so as to ensure that the context is as much as possible in the prediction process, and the context fragmentation problem is alleviated.

[0097] In an embodiment of the present application, there are three text segments in total, namely text segment 1, text segment 2 and text segment 3. The three text segments are sequentially encoded by the encoding unit of the intent recognition model. When encoding the text segment 1, since the text segment 1 has no previous text, the corresponding extension information is empty, that is, the text segment 1 is directly encoded to obtain the encoding sub-vector 1 corresponding to the text segment 1 and the hidden state sequence 1, and the hidden state sequence 1 is taken as the extension information of the text segment 2. After processing the text segment 1, the text segment 2 is encoded. First, the text segment 2 and the hidden state sequence 1 are fused, and then the fusion result is encoded to obtain the encoding sub-vector 2 corresponding to the text segment 2 and the hidden state sequence 2, and the hidden state sequence 2 is taken as the extension information of the text segment 3. After processing the text segment 2, the text segment 3 is encoded. First, the text segment 3 and the hidden state sequence 2 are fused, and then the fusion result is encoded to obtain the encoding sub-vector 3 corresponding to the text segment 3, that is, the hidden state sequence 3. Thus, the encoding processing of each text segment is completed. Then, the encoding sub-vectors corresponding to each text segment are spliced to obtain the encoding vector corresponding to the entire target dialogue text, which is used for subsequent input to the decoding layer.

[0098] As can be seen, the intent recognition model provided in the present application uses a recursive mechanism. When the model processes the next text segment, the hidden state information in the previous sequence is fixed and cached, and is reused as extension information when the model processes the next text segment. As shown in Figure 3 , the gradient is only maintained in an independent segment, but the additional input information (extension information) allows the model to use historical information, thereby enabling modeling of long-term dependencies and avoiding the problem of context fragmentation.

[0099] In actual application, after the target dialogue text is segmented, multiple text segments are obtained. When the multiple text segments are input to the intent recognition model for processing, the intent recognition model sequentially encodes the text segments. Therefore, it is necessary to determine the processing order of the text segments. Specifically, the encoding unit sequentially encodes the at least two text segments to obtain an encoding vector, including:

[0100] Obtaining the arrangement order between each text segment in the at least two text segments;

[0101] The encoding unit sequentially encodes each text segment according to the arrangement order to obtain an encoding sub-vector corresponding to each text segment;

[0102] The encoding vector is composed of the encoding sub-vectors corresponding to each text segment.

[0103] The arrangement order can be understood as the splicing order between the text segments. All the text segments are spliced according to the arrangement order, and thus the target dialogue text can be reversely obtained. Therefore, the arrangement order can be obtained from the cutting order when the target dialogue text is cut. For example, when the target dialogue text is cut, the first cutting obtains the text segment 1, the second cutting obtains the text segment 2, and the n-th cutting obtains the text segment n. The corresponding cutting order is “1-2-…-n”, that is, the arrangement order is “text segment 1-text segment 2-…-text segment n”. Subsequently, the encoding unit can sequentially encode each text segment according to the arrangement order.

[0104] In an embodiment of the present application, the arrangement order between each text segment in the three text segments is obtained, which is “text segment 1-text segment 2-text segment 3” in turn. The encoding unit sequentially encodes the three text segments according to the arrangement order, and the processing order is: text segment 1-text segment 2-text segment 3. After obtaining the encoding sub-vector corresponding to each text segment, the encoding vector corresponding to the target dialogue text can be obtained.

[0105] By determining the arrangement order between each text segment, the intention recognition model sequentially processes all the text segments according to the arrangement order, so that the context information of each text segment is correctly maintained, thereby improving the correctness of the model prediction. Specifically, the encoding unit sequentially encodes the at least two text segments to obtain an encoding vector, including:

[0106] In the at least two text segments, the i-th text segment is determined, and the extension information corresponding to the i-th text segment is determined, wherein the extension information corresponding to the i-th text segment is obtained by encoding the (i-1)-th text segment;

[0107] The i-th text segment and the extension information corresponding to the i-th text segment are fused, and the fusion result is encoded by the encoding unit to obtain the encoding sub-vector corresponding to the i-th text segment and the extension information corresponding to the (i+1)-th text segment;

[0108] It is determined whether there is an uncoded text segment in the at least two text segments;

[0109] If yes, the extension information corresponding to the (i+1)-th text segment is cached, i is incremented by 1, and the steps of determining the i-th text segment in the at least two text segments and determining the extension information corresponding to the i-th text segment are executed;

[0110] If no, the encoding vector is obtained according to each encoding sub-vector.

[0111] In actual application, when a text segment to be encoded is determined in multiple text segments, the extended information corresponding to the text segment, i.e., the hidden state sequence of the previous text segment of the text segment, can be determined at the same time. The hidden state sequence of the text segment and the previous text segment is fused and encoded, so that the encoding sub-vector corresponding to the text segment and the extended information to be fused of the next text segment can be obtained. At this time, it is judged whether there is still an unencoded text segment in all text segments. If there is, the encoding processing of the next text segment is continued. If there is not, it is indicated that all text segments have completed the encoding processing. At this time, the encoding vector can be obtained according to each encoding sub-vector.

[0112] In an embodiment of the present application, as in the above example, the first text segment 1 is determined as the text segment to be encoded in the three text segments. Since the text segment is the first one, the corresponding extended information is empty. Therefore, the text segment is directly encoded to obtain the encoding sub-vector corresponding to the text segment 1 and the extended information corresponding to the text segment 2, i.e., the hidden state sequence corresponding to the text segment 1. At this time, it is judged that there is still an unencoded text segment. Therefore, the second text segment 2 is determined as the text segment to be encoded, and the same steps are executed until all three text segments complete the encoding processing. At this time, the encoding vector can be obtained according to the encoding sub-vector corresponding to each text segment.

[0113] In specific implementation, since the encoding unit of the intent recognition model includes multiple hidden layers, each text segment also includes n hidden layer sequences, i.e., each text segment corresponds to n layers of extended information.

[0114] Correspondingly, any layer of extended information of each text segment can be obtained by the following method, including:

[0115]

[0116]

[0117]

[0118] Wherein, represents the n-1 layer of extended information of the τ+1 segment spliced with the n-1 layer of extended information of the τ segment; SG represents gradient non-backpropagation; represents a query vector, represents a key vector, represents a value vector; represents a query matrix, represents a key matrix, represents a value matrix; represents the n layer of extended information of the τ+1 segment.

[0119] Two consecutive segments of length L are denoted as s τ = [x τ,1 ,…,x τ,L ] and s τ+1 = [x τ+1,1 ,…,x τ+1,L ], and the hidden state sequence generated by the nth layer in the τth segment is denoted as where d denotes the dimension of the hidden layer. The hidden state sequence of the nth layer in the segment s τ+1 can be generated according to the above rules.

[0120] Therefore, the hidden state sequence of each layer of each text segment can be calculated by the above method, so as to obtain the encoding sub-vector output by the last layer, so that the hidden state sequence of the previous text segment is reused as an extended context, avoiding the problem of context fragmentation. The encoding sub-vectors of each text segment can be combined to obtain an encoding vector, which is input to a decoding unit.

[0121] Step 208: decoding the encoding vector by the decoding unit to obtain an intent category probability distribution corresponding to the target dialogue text and outputting the intent recognition model.

[0122] The intent category probability distribution can be understood as the probability value of each intent category, for example, in the scenario of predicting the satisfaction of parents to teachers, the intent categories include: high, medium and low, and the intent probability distribution is the prediction probability of the three intent categories. The intent category with the highest probability value can be determined as the target intent category according to the intent category probability distribution.

[0123] In actual application, after the intent recognition model outputs the intent category probability distribution, the intent category with the highest probability can be determined according to the intent category probability distribution, and the corresponding service can be provided for the user based on the intent category. In an embodiment of the present application, in the scenario of communication between teachers and parents, it is predicted that the parents are highly satisfied with the teacher, and the related courses of the teacher can be continuously provided for the parents in the subsequent process, so as to improve the satisfaction of the parents to the service.

[0124] In actual application, the probability of each intent category can be obtained by linearly changing the encoding vector. Specifically, the encoding vector is decoded by the decoding unit to obtain the intent category probability distribution corresponding to the target dialogue text, including:

[0125] The decoding unit normalizes the encoding vector to obtain the probability value of each intent category.

[0126] ​Generate an intent category probability distribution corresponding to the target dialogue text according to the probability value of each intent category.

[0127] In the formula, the normalization processing can be understood as a calculation processing using a softmax function. In a specific implementation, hidden layer parameters h in an encoding vector are subjected to a linear transformation to obtain a probability of each intent category c. For details, refer to formula 1:

[0128] p(c|h)=softmax(Wh) Formula 1

[0129] In the formula, W is a parameter matrix to be learned by the intent recognition model, that is, Wq, Wk, and Wv are parameters to be learned by the model, h is a hidden layer parameter in an encoding vector, and c is an intent category.

[0130] As can be seen, the probability of each intent category c can be obtained according to the above normalization processing, so that the intent category probability distribution can be determined, and further, the target intent category with the highest probability can be selected according to the intent category probability distribution. Specifically, the method further includes:

[0131] Determining a target intent category according to the intent category probability distribution output by the intent recognition model;

[0132] Selecting a corresponding target response text according to the target intent category, wherein the target response text is used to feedback the target dialogue text.

[0133] In the formula, the target intent category can be understood as a predicted user intent, and the target response text can be selected according to the target intent category. The target response text can be understood as a corresponding reply technique. For example, when a teacher asks a parent for a follow-up report intention for a tutoring course, the target intent category is predicted to be high, and then the teacher can recommend relevant tutoring courses to the parent in subsequent communication, thereby improving the teaching service instruction of the teacher and the satisfaction of the parent. If the target intent category is detected to be low, the target response text may include a query to the parent for a suggestion for a tutoring course, or a technique for recommending other tutoring courses.

[0134] In actual applications, the target intent category is determined by the intent category probability distribution output by the model, which provides data support for intelligent sales, data mining, quality inspection, training, and management scenarios, and is no longer limited to judging the demand intention of a customer by artificial means, thereby better providing corresponding services for the customer and improving the satisfaction of the customer.

[0135] In summary, by using the intent recognition model provided in the present application, the intent category of the user in the long dialogue text can be obtained, which facilitates subsequent provision of corresponding services to the user, thereby improving user satisfaction. The intent recognition model provided in the present application introduces a recursive mechanism, and by using the self-recurrence feature, the semantic information of the entire text can be better captured, and the accuracy of the intent category prediction can be improved.

[0136] Further, the intent recognition model provided in the embodiments of the present application can be obtained by training in the following manner, comprising:

[0137] obtaining a sample dialogue text and a sample intent category probability distribution corresponding to the sample dialogue text, and dividing the sample dialogue text into at least two sample text segments;

[0138] inputting the at least two sample text segments into an initial intent recognition model to obtain a predicted intent category probability distribution output by the initial intent recognition model;

[0139] calculating a model loss value according to the sample intent category probability distribution and the predicted intent category probability distribution;

[0140] adjusting the model parameters of the initial intent recognition model based on the model loss value, and continuing to train the initial intent recognition model until an intent recognition model satisfying a training condition is obtained.

[0141] The sample dialogue text can be understood as training data for training the initial intent recognition model, and the sample intent category probability distribution can be understood as a correct prediction result. After inputting the sample dialogue text into the initial intent recognition model, the initial intent recognition model can output a prediction result, i.e., a predicted intent category probability distribution. According to the predicted intent category probability distribution and the sample intent category probability distribution, the model loss value can be calculated.

[0142] In actual application, the model loss value can be calculated by using a cross-entropy loss function. Specifically, the model loss value is calculated according to the sample intent category probability distribution and the predicted intent category probability distribution, comprising: calculating a cross-entropy loss function according to the sample intent category probability distribution and the predicted intent category probability distribution; and determining the model loss value according to the calculation result.

[0143] Therefore, after calculating the model loss value, the model parameters can be adjusted according to the model loss value, and the initial intent recognition model can be continuously trained using the next training data until an intent recognition model satisfying a training condition is obtained. Specifically, the training condition comprises: the model loss value is less than a preset loss value threshold; and / or the training round reaches a preset training round.

[0144] The preset loss threshold can be understood as the user-defined expected loss value. When the loss value is less than the preset loss threshold, it indicates that the current model has been successfully trained and meets the user's expected standard.

[0145] Training epochs can be understood as the number of times the model is trained using sample data; preset training epochs can be understood as the number of times the model is trained using sample data as set by the user. After the model has used sample data for the preset training epochs, the model stops training.

[0146] In one specific embodiment provided in this application, taking the stopping of training of the intent recognition model by the loss value being less than a preset loss value threshold as an example, the preset loss value threshold is 0.5. When the calculated loss value is less than 0.5, the intent recognition model is considered to have completed training.

[0147] In another specific embodiment provided in this application, taking the preset number of training rounds to stop training the intent recognition model as an example, the preset number of training rounds is 20 rounds. When the number of training rounds of the sample data reaches 20 rounds, it is determined that the intent recognition model has been trained.

[0148] This application provides an intent recognition method, comprising: acquiring target dialogue text and segmenting the target dialogue text into at least two text segments; inputting the at least two text segments into an intent recognition model, wherein the intent recognition model includes an encoding unit and a decoding unit; sequentially encoding the at least two text segments through the encoding unit to obtain an encoding vector, wherein the encoding vector is composed of an encoding sub-vector obtained by fusing extended information into each text segment; and decoding the encoding vector through the decoding unit to obtain the intent category probability distribution corresponding to the target dialogue text and outputting the intent recognition model. By segmenting the target dialogue text, the intent recognition model processes each text segment sequentially, achieving the effect of encoding and decoding the entire target dialogue text. Furthermore, during the encoding process, each text segment is fused with extended information before encoding, thus achieving context dependency and solving the problem of context fragmentation, thereby improving the model's prediction accuracy.

[0149] The following is in conjunction with the appendix Figure 4 Taking the application of the intent recognition method provided in this application in course renewal intent recognition as an example, the intent recognition method will be further explained. Among other things, Figure 4 This paper presents a flowchart illustrating an intent recognition method for course renewal intent recognition according to an embodiment of this application, which specifically includes the following steps:

[0150] Step 402: Obtain the dialogue information set related to the target business.

[0151] The target service is a course registration service, and the set of dialogue information associated with the target service is a set of dialogue information about whether to continue to register for a course between a teacher and a parent.

[0152] Step 404: Data cleaning is performed on the initial dialogue information included in the set of dialogue information, to obtain a target dialogue information set including target dialogue information.

[0153] The data cleaning rules include filtering invalid dialogue information in the set of dialogue information, such as filtering unanswered calls, short content dialogue, etc.; deleting invalid characters such as mood words and noise; and correcting the identity of the speaker.

[0154] Step 406: At least two dialogue texts corresponding to the target dialogue information in the target dialogue information set are determined, and the target dialogue text is obtained by splicing the at least two dialogue texts.

[0155] The at least two dialogue texts include dialogue texts between a teacher and a parent, and a long string obtained by splicing multiple dialogue texts between the teacher and the parent is the target dialogue text.

[0156] Step 408: A preset segmentation strategy is obtained, and a segmentation window is determined according to the preset segmentation strategy. The target dialogue text is segmented according to the segmentation window to obtain at least two text segments.

[0157] The preset segmentation strategy includes a segmentation window size, and the target dialogue text is segmented according to the segmentation window to obtain multiple text segments.

[0158] Step 410: The at least two text segments are input into an intent recognition model, wherein the intent recognition model includes an encoding unit and a decoding unit.

[0159] In specific implementation, the multiple text segments are input into the intent recognition model, and each text segment is processed by the intent recognition model in sequence.

[0160] Step 412: The arrangement order between each text segment in the at least two text segments is obtained.

[0161] The arrangement order is obtained from the segmentation order of the text segments, and is “text segment 1-text segment 2-…-text segment n”.

[0162] Step 414: Each text segment is encoded by the encoding unit in the arrangement order to obtain an encoding sub-vector corresponding to each text segment.

[0163] In specific implementation, step 414 can be implemented by steps S4140-S4146:

[0164] S4140: determining an i-th text segment in the at least two text segments, and determining the extended information corresponding to the i-th text segment, wherein the extended information corresponding to the i-th text segment is obtained by encoding the (i-1)-th text segment.

[0165] S4142: fusing the i-th text segment and the extended information corresponding to the i-th text segment, and performing encoding processing on the fusion result by the encoding unit to obtain an encoding sub-vector corresponding to the i-th text segment and the extended information corresponding to the (i+1)-th text segment.

[0166] S4144: determining whether there is an uncoded text segment in the at least two text segments.

[0167] S4146: if yes, caching the extended information corresponding to the (i+1)-th text segment, and increasing i by 1, and performing the steps of determining an i-th text segment in the at least two text segments and determining the extended information corresponding to the i-th text segment; if no, obtaining an encoding vector according to each encoding sub-vector.

[0168] Step 416: performing normalization processing on the encoding vector by the decoding unit to obtain a probability value of each intent category, and generating an intent category probability distribution corresponding to the target dialogue text according to the probability value of each intent category.

[0169] In a specific implementation, the preset intent categories are divided into three types: high, medium and low, which represent the intention of the parent for course registration, and the intent category probability distribution is "high: 40, medium: 35, and low: 25".

[0170] The intent recognition method provided by the application for course re-registration intent recognition can realize the effect of encoding and decoding processing on the whole target dialogue text by splitting the target dialogue text and making the intent recognition model process each text segment in turn, and can realize context dependence and solve the problem of context fragmentation by fusing the extended information of each text segment before encoding processing in the encoding process, thereby improving the model prediction accuracy.

[0171] Corresponding to the method embodiments described above, the application also provides intent recognition device embodiments, Figure 5 Fig. 1 shows a structural schematic diagram of an intent recognition device according to an embodiment of the application. As shown in the figure, the device comprises: Figure 5

[0172] The splitting module 502 is configured to obtain a target dialogue text and split the target dialogue text into at least two text segments.

[0173] ​The input module 504 is configured to input the at least two text segments to an intent recognition model, where the intent recognition model comprises an encoding unit and a decoding unit.

[0174] The encoding module 506 is configured to perform encoding processing on the at least two text segments in sequence by the encoding unit to obtain an encoding vector, where the encoding vector is composed of encoding sub-vectors obtained by each text segment fused with extended information encoding.

[0175] The decoding module 508 is configured to perform decoding processing on the encoding vector by the decoding unit to obtain an intent category probability distribution corresponding to the target dialogue text and output the intent recognition model.

[0176] Optionally, the segmentation module 502 is further configured to:

[0177] obtain a dialogue information set associated with a target service;

[0178] perform data cleaning on initial dialogue information contained in the dialogue information set to obtain a target dialogue information set containing target dialogue information;

[0179] determine at least two dialogue texts corresponding to the target dialogue information in the target dialogue information set, and obtain the target dialogue text by splicing the at least two dialogue texts, where each of the at least two dialogue texts contains a speaker identifier.

[0180] Optionally, the segmentation module 502 is further configured to:

[0181] determine a data cleaning link containing a plurality of data cleaning nodes;

[0182] select a data cleaning rule corresponding to an i-th data cleaning node in the data cleaning link to perform data cleaning on the initial dialogue information contained in the dialogue information set to obtain an initial dialogue information set;

[0183] determine whether the data cleaning link contains an unexecuted data cleaning node;

[0184] if yes, i is incremented by 1, the initial dialogue information set is taken as the dialogue information set, and the step of selecting the data cleaning rule corresponding to the i-th data cleaning node in the data cleaning link is performed;

[0185] if no, the initial dialogue information set is taken as the target dialogue information set containing target dialogue information.

[0186] Optionally, the segmentation module 502 is further configured to:

[0187] obtain a preset segmentation strategy, and determine a segmentation window according to the preset segmentation strategy;

[0188] segment the target dialogue text according to the segmentation window to obtain at least two text segments.

[0189] Optionally, the encoding module 506 is further configured to:

[0190] obtain an arrangement order between each of the at least two text segments;

[0191] encode each of the text segments in sequence according to the arrangement order by using the encoding unit to obtain an encoding sub-vector corresponding to each of the text segments;

[0192] compose an encoding vector according to the encoding sub-vector corresponding to each of the text segments.

[0193] Optionally, the encoding module 506 is further configured to:

[0194] determine an i-th text segment in the at least two text segments, and determine extension information corresponding to the i-th text segment, wherein the extension information corresponding to the i-th text segment is obtained by encoding an (i-1)-th text segment;

[0195] fuse the i-th text segment and the extension information corresponding to the i-th text segment, and encode the fusion result by using the encoding unit to obtain an encoding sub-vector corresponding to the i-th text segment and extension information corresponding to an (i+1)-th text segment;

[0196] determine whether there is an uncoded text segment in the at least two text segments;

[0197] if yes, cache the extension information corresponding to the (i+1)-th text segment, and increase i by 1, and execute the steps of determining the i-th text segment in the at least two text segments and determining the extension information corresponding to the i-th text segment;

[0198] if no, compose the encoding vector according to each of the encoding sub-vectors.

[0199] Optionally, the decoding module 508 is further configured to:

[0200] normalize the encoding vector by using the decoding unit to obtain a probability value of each intent category;

[0201] generate an intent category probability distribution corresponding to the target dialogue text according to the probability value of each intent category.

[0202] Optionally, the apparatus further comprises a determination module configured to:

[0203] determine a target intent category according to the intent category probability distribution output by the intent recognition model;

[0204] select a corresponding target response text according to the target intent category, wherein the target response text is used to feed back the target dialogue text.

[0205] Optionally, the apparatus further comprises a training module configured to:

[0206] obtain sample dialogue texts and sample intent category probability distributions corresponding to the sample dialogue texts, and divide the sample dialogue texts into at least two sample text segments;

[0207] input the at least two sample text segments into an initial intent recognition model to obtain a predicted intent category probability distribution output by the initial intent recognition model;

[0208] calculate a model loss value according to the sample intent category probability distribution and the predicted intent category probability distribution;

[0209] adjust model parameters of the initial intent recognition model based on the model loss value, and continue to train the initial intent recognition model until an intent recognition model satisfying a training condition is obtained.

[0210] Optionally, the apparatus further comprises a training module configured to:

[0211] calculate a cross-entropy loss function according to the sample intent category probability distribution and the predicted intent category probability distribution;

[0212] determine a model loss value according to the calculation result.

[0213] The application provides an intention recognition device, which comprises a segmentation module configured to acquire target dialogue text and segment the target dialogue text into at least two text segments; an input module configured to input the at least two text segments into an intention recognition model, wherein the intention recognition model comprises an encoding unit and a decoding unit; an encoding module configured to sequentially perform encoding processing on the at least two text segments by the encoding unit to obtain an encoding vector, wherein the encoding vector is composed of encoding sub-vectors obtained by each text segment fusing and expanding information coding; and a decoding module configured to perform decoding processing on the encoding vector by the decoding unit to obtain an intention category probability distribution corresponding to the target dialogue text and output the intention recognition model. By segmenting the target dialogue text, the intention recognition model sequentially processes each text segment, realizes the effect of encoding and decoding processing on the whole target dialogue text, and in the encoding process, each text segment is fused and expanded before being encoded, realizes context dependence and solves the problem of context fragmentation, and improves the model prediction accuracy.

[0214] The above is a schematic scheme of the intention recognition device of the embodiment. It should be noted that the technical scheme of the intention recognition device belongs to the same concept as the technical scheme of the intention recognition method described above, and the details of the technical scheme of the intention recognition device that are not described in detail can be referred to the description of the technical scheme of the intention recognition method.

[0215] Figure 6 A structural block diagram of a computing device 600 according to an embodiment of the application is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 through a bus 630, and a database 650 is used to save data.

[0216] The computing device 600 further includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 can include one or more of any type of network interface (e.g., network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like, either wired or wireless.

[0217] In an embodiment of the application, the above components of the computing device 600 and Figure 6Other components not shown can also be connected to each other in the computing device, such as through a bus. It should be understood that Figure 6 The computing device structure diagram shown is merely for the purpose of example, and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.

[0218] The computing device 600 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. The computing device 600 can also be a mobile or stationary server.

[0219] Wherein the processor 620 implements the steps of the intention recognition method when executing the computer instructions.

[0220] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device belongs to the same concept as the technical scheme of the intention recognition method described above, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the intention recognition method.

[0221] The embodiment of the present application also provides a computer readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the intention recognition method as described above.

[0222] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium belongs to the same concept as the technical scheme of the intention recognition method described above, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the intention recognition method.

[0223] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0224] The computer readable medium can include any entity or apparatus capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium can include appropriate additions or subtractions according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.

[0225] It should be noted that for the foregoing method embodiments, the descriptions are expressed as a combination of a series of actions for the sake of simplicity, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0226] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0227] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The alternative embodiments do not describe all the details and do not limit the present application to the specific embodiments described. Obviously, according to the content of the present application, many modifications and changes can be made. The present application selects and describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can well understand and utilize the present application. The present application is limited by the claims and their entire scope and equivalents.

Claims

1. An intention recognition method characterized by, The method comprises the following steps: acquiring target dialogue text, and cutting the target dialogue text into at least two text segments; inputting the at least two text segments into an intent recognition model, wherein the intent recognition model comprises an encoding unit and a decoding unit; sequentially performing encoding processing on the at least two text segments by the encoding unit to obtain an encoding vector, wherein the encoding vector is composed of encoding sub-vectors obtained by fusing and expanding information coding of each text segment, and the sequentially performing encoding processing on the at least two text segments by the encoding unit to obtain an encoding vector comprises the following steps: determining a target text segment in the at least two text segments, and determining expansion information of the target text segment, wherein the expansion information of the target text segment is obtained by encoding of a previous text segment of the target text segment; fusing the target text segment and the expansion information corresponding to the target text segment, and performing encoding on the fused target text segment and the expansion information corresponding to the target text segment; returning to the step of determining a target text segment in the at least two text segments, and determining expansion information of the target text segment, until there is no unencoded text segment in the at least two text segments; performing decoding processing on the encoding vector by the decoding unit to obtain an intent category probability distribution corresponding to the target dialogue text and outputting the intent category probability distribution by the intent recognition model.

2. The method of claim 1, wherein, Acquiring target dialogue text comprises the following steps: acquiring a dialogue information set associated with a target service; performing data cleaning on initial dialogue information contained in the dialogue information set to obtain a target dialogue information set containing target dialogue information; determining at least two dialogue texts corresponding to the target dialogue information in the target dialogue information set, and obtaining the target dialogue text by splicing the at least two dialogue texts, wherein each dialogue text in the at least two dialogue texts contains a speaker identifier.

3. The method of claim 2, wherein, Performing data cleaning on initial dialogue information contained in the dialogue information set to obtain a target dialogue information set containing target dialogue information comprises the following steps: determining a data cleaning link containing a plurality of data cleaning nodes; selecting a data cleaning rule corresponding to an i-th data cleaning node in the data cleaning link to perform data cleaning on the initial dialogue information contained in the dialogue information set to obtain an initial dialogue information set; determining whether there is an unexecuted data cleaning node in the data cleaning link; if yes, increasing i by 1, taking the initial dialogue information set as the dialogue information set, and performing the step of selecting a data cleaning rule corresponding to an i-th data cleaning node in the data cleaning link; if no, taking the initial dialogue information set as a target dialogue information set containing target dialogue information.

4. The method of claim 1, wherein, Cutting the target dialogue text into at least two text segments comprises the following steps: acquiring a preset cutting strategy, and determining a cutting window according to the preset cutting strategy; performing cutting processing on the target dialogue text according to the cutting window to obtain at least two text segments.

5. The method of claim 1, wherein, The sequentially performing encoding processing on the at least two text segments by the encoding unit to obtain an encoding vector comprises the following steps: obtaining an arrangement order between each of the at least two text segments; encoding each text segment in sequence according to the arrangement order by the encoding unit to obtain a corresponding encoding sub-vector of each text segment; composing an encoding vector according to the corresponding encoding sub-vector of each text segment.

6. The method of claim 1, wherein, decoding the encoding vector by the decoding unit to obtain an intent category probability distribution corresponding to the target dialogue text, including: normalizing the encoding vector by the decoding unit to obtain a probability value of each intent category; generating the intent category probability distribution corresponding to the target dialogue text according to the probability value of each intent category.

7. The method of claim 1, wherein, The method further includes: determining a target intent category according to the intent category probability distribution output by the intent recognition model; selecting a corresponding target response text according to the target intent category, wherein the target response text is used to feedback the target dialogue text.

8. The method according to any one of claims 1 to 7, characterized in that, The intent recognition model can be obtained by training, including: obtaining sample dialogue texts and sample intent category probability distributions corresponding to the sample dialogue texts, and dividing the sample dialogue texts into at least two sample text segments; inputting the at least two sample text segments into an initial intent recognition model to obtain a predicted intent category probability distribution output by the initial intent recognition model; calculating a model loss value according to the sample intent category probability distribution and the predicted intent category probability distribution; adjusting model parameters of the initial intent recognition model based on the model loss value, and continuing to train the initial intent recognition model until an intent recognition model meeting a training condition is obtained.

9. The method of claim 8, wherein, calculating a model loss value according to the sample intent category probability distribution and the predicted intent category probability distribution, including: calculating a cross-entropy loss function according to the sample intent category probability distribution and the predicted intent category probability distribution; determining the model loss value according to the calculation result.

10. An intention recognition apparatus characterized by comprising: including: a segmentation module configured to obtain a target dialogue text and divide the target dialogue text into at least two text segments; an input module configured to input the at least two text segments into an intent recognition model, wherein the intent recognition model includes an encoding unit and a decoding unit; an encoding module configured to encode the at least two text segments in sequence by the encoding unit to obtain an encoding vector, wherein the encoding vector is composed of encoding sub-vectors obtained by each text segment fusing and expanding information encoding; The encoding module is further configured to determine a target text segment in the at least two text segments, determine extended information of the target text segment, wherein the extended information of the target text segment is obtained from a previous text segment of the target text segment, fuse the target text segment and the extended information corresponding to the target text segment, encode the fused target text segment and the extended information corresponding to the target text segment, and return to the step of determining the target text segment in the at least two text segments and determining the extended information of the target text segment until there is no uncoded text segment in the at least two text segments; The decoding module is configured to decode the encoding vector by the decoding unit, obtain the intent category probability distribution corresponding to the target dialogue text, and output the intent category probability distribution by the intent recognition model.

11. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein, The processor executes the computer instructions to implement the steps of the method in any one of claims 1-9.

12. A computer-readable storage medium storing computer instructions, wherein, The computer instructions are executed by the processor to implement the steps of the method in any one of claims 1-9.

13. A computer program product, characterised in that, The computer instructions are executed by the processor to implement the steps of the method in any one of claims 1-9. The computer instructions are executed by the processor to implement the steps of the method in any one of claims 1-9.

Citation Information

Patent Citations

  • Multi-round dialogue classification method based on resampling

    CN113672726A