Intention recognition method and device, electronic equipment and storage medium

By combining keyword matching and sliding window enumeration methods with a classification model, user intent is identified, solving the problems of accuracy and efficiency in intent recognition in customer service dialogues. This achieves high recall and low omission in intent tag confirmation, supporting real-time communication strategies for customer service.

CN116127011BActive Publication Date: 2025-10-21MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211469093.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2025-10-21
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

During customer service conversations with users, existing technologies struggle to accurately identify multiple intentions expressed by users, especially when the conversation is long. Manual memorization is prone to errors, and multi-intention classification models have high training costs and poor classification performance.

Method used

User intent is identified through two methods: keyword matching and sliding window enumeration. A keyword list with high tag recall is used to determine whether the current sentence contains keywords. If keywords are present, contextual information is located. The intent tag is confirmed by combining the first classification model and the second classification model to ensure high recall and accuracy.

Benefits of technology

It improves the accuracy and efficiency of intent recognition, avoids the omission of intent tags and conflicting scenario types, and outputs multi-tag combinations in real time to provide customer service with effective communication strategy support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127011B_ABST
    Figure CN116127011B_ABST
Patent Text Reader

Abstract

The application provides an intention recognition method and device, electronic equipment and storage medium. The method comprises the following steps: determining whether a current sentence in a dialogue contains a keyword in a keyword table; in the case that the current sentence contains the keyword, determining a target label corresponding to the keyword, and in the case that an intention label corresponding to the current sentence is the target label, taking the target label as a first intention label; sequentially positioning local text information in the dialogue according to a preset step and a preset window size; in the case that the first intention label comprises a secondary label, determining that the secondary label is a reference intention label, inputting a primary label to which the reference intention label belongs and the local text information into a second classification model to obtain a second classification result, and the second classification result comprises a second intention label; and taking the first intention label and the second intention label as an intention label of the dialogue. The technical scheme of the application can output the recognized intention label in real time during the dialogue process, which is beneficial to providing communication strategy support for customer service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] During a conversation between customer service and a user, the user may express multiple intents. In some cases, these multiple intents need to be accurately identified and recorded for downstream staff to process or facilitate subsequent work. Generally, multiple intents expressed during a conversation can be recorded manually, but this approach is prone to errors and omissions. Alternatively, a multi-intent classification model can be used to classify the conversation content to obtain multiple intents. This approach places high demands on the model and has high training costs. Especially for long conversations, the model's classification performance is poor, making it difficult to accurately obtain multiple intents. Summary of the Invention

[0003] In view of this, the embodiments of the present application provide an intent recognition method, device, electronic device and storage medium, which can output the recognized intent labels in real time during the conversation between customer service and users through keyword matching and sliding window enumeration methods, and obtain a multi-label combination of the conversation, which is conducive to providing communication strategy support for customer service during the conversation.

[0004] In a first aspect, an embodiment of the present application provides an intent recognition method, comprising: determining, based on a keyword table, whether a current sentence in a conversation contains a keyword in the keyword table, wherein the keyword table includes multiple tags and at least one keyword corresponding to each tag, and the tag recall rate of each keyword in the keyword table is greater than or equal to a first preset threshold; if the current sentence contains the keyword, determining a target tag corresponding to the keyword, and obtaining context information containing the current sentence, inputting the context information into a first classification model to obtain a first classification result, the first classification result being used to determine whether the intent tag corresponding to the current sentence is the target tag, and if the intent tag corresponding to the current sentence is the target tag, using the target tag as the first intent tag; locating local text information in the conversation in sequence according to a preset step size and a preset window size; if the first intent tag includes a secondary tag, determining the secondary tag as a reference intent tag, inputting the primary tag and local text information to which the reference intent tag belongs into a second classification model to obtain a second classification result, the second classification result including a second intent tag, and the scene type of the primary tag corresponding to the second intent tag is the same as the scene type of the primary tag corresponding to the first intent tag, and the types of intent tags classified by the first classification model and the second classification model are different; using the first intent tag and the second intent tag as the intent tags of the conversation.

[0005] In a second aspect, an embodiment of the present application provides an intention recognition device, comprising: a determination module for determining, based on a keyword table, whether a current sentence in a conversation contains a keyword in the keyword table, wherein the keyword table includes a plurality of tags and at least one keyword corresponding to each tag, and the tag recall rate of each keyword in the keyword table is greater than or equal to a first preset threshold; a first classification module for determining, when the current sentence contains the keyword, a target tag corresponding to the keyword, and obtaining context information containing the current sentence, inputting the context information into a first classification model, obtaining a first classification result, and the first classification result is used to determine whether the intention tag corresponding to the current sentence is the target tag. When the intention tag corresponding to the current sentence is the target tag, In the case of a tag, the target tag is used as the first intent tag; the second classification module is used to locate the local text information in the conversation in sequence according to a preset step size and a preset window size, and when the first intent tag includes a secondary tag, the secondary tag is determined to be the reference intent tag, and the first-level tag and the local text information to which the reference intent tag belongs are input into the second classification model to obtain a second classification result, the second classification result includes the second intent tag, and the first-level tag corresponding to the second intent tag has the same scene type as the first-level tag corresponding to the first intent tag, and the types of intent tags classified by the first classification model and the second classification model are different; the determination module is also used to use the first intent tag and the second intent tag as intent tags for the conversation.

[0006] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor; and a memory for storing processor-executable instructions, wherein the processor is used to execute the intention recognition method described in the first aspect above.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the intention recognition method described in the first aspect above.

[0008] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed by a processor of a computer device, the computer device is able to execute the intention recognition method described in the first aspect above.

[0009] The embodiments of the present application provide an intent recognition method, device, electronic device and storage medium, which determines whether the current sentence contains keywords in the keyword table based on a keyword table with a high label recall rate, and locates the context information of the current sentence when the keyword exists in the current sentence, and uses a first classification model to classify the context information to determine whether the intent label corresponding to the context information is the target label corresponding to the keyword. If so, the target label corresponding to the keyword is used as the first intent label of the current sentence, which can further improve the accuracy of intent recognition while ensuring a high recall rate. Moreover, determining the intent label by keyword matching can improve the efficiency of intent recognition, and classifying the identified intent labels by the first classification model can improve the accuracy of the recognition results while ensuring efficiency. Further, the local text information is located by a sliding window enumeration method, and when the first intent label includes a secondary label, the first-level label and the local text information corresponding to the first intent label are input into the second classification model to obtain a second intent label. This approach overcomes the shortcomings of intent recognition through keyword matching, identifying intents that keyword matching cannot, thus avoiding missed intent labels. It also prevents scenario type conflicts between the first-level label corresponding to the second intent label and the first-level label corresponding to the first intent label, thereby reducing the likelihood that the second classification model will output an intent label that does not match the scenario type involved in the conversation. Furthermore, through keyword matching and sliding window enumeration, recognized intent labels can be output in real time during the conversation between customer service and users, resulting in a multi-label combination of the conversation, which in turn facilitates communication strategy support for customer service during the conversation. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 Shown is a schematic diagram of the system architecture of an intention recognition system provided by an exemplary embodiment of the present application.

[0011] Figure 2 Shown is a flowchart of an intention recognition method provided by an exemplary embodiment of the present application.

[0012] Figure 3 Shown is a flowchart of an intention recognition method provided by another exemplary embodiment of the present application.

[0013] Figure 4 Shown is a schematic structural diagram of an intention recognition device provided by an exemplary embodiment of the present application.

[0014] Figure 5 Shown is a block diagram of an electronic device for executing an intent recognition method provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0016] Application Overview

[0017] When users communicate with customer service, they may express multiple intents in a single conversation. For example, in telesales scenarios, users may express multiple intents to customer service, such as "purchase," "sign," "renew," and "inquire about purchase terms." In resource acquisition scenarios, users may express multiple intents to customer service, such as "early repayment," "deferred repayment," "account cancellation," and "interest reduction." Customer service needs to record intent tags for the current work order based on the intent expressed by the user during the conversation for downstream staff to handle. However, when the conversation is long and the user expresses multiple intents, recording intent tags for the current work order through customer service memory is more difficult for customer service, as it requires a high level of memory and business knowledge. Furthermore, recording intent tags in this way is prone to errors and it is difficult to record all intents. In other words, the accuracy of intent tags is difficult to guarantee, and intent tags are easily missed.

[0018] In addition to recording intent labels through customer service memory, a multi-intent classification model can also be used to classify the entire conversation to obtain multiple intent labels. However, this method places high demands on the model. For example, in some cases, the text of the entire conversation after speech-to-text conversion can be over 5,000 words long. Using a large deep learning model as a classifier would result in high training costs, poor inference performance, and low efficiency.

[0019] In response to the above technical problems, the embodiments of the present application use two methods to analyze the intentions contained in the local content during the user conversation in real time. Since these two methods can complement each other, they can identify all the intentions in the conversation as much as possible while ensuring the accuracy of the recognition results, avoiding missing intentions.

[0020] Exemplary Systems

[0021] Figure 1 FIG. 1 is a schematic diagram of the system architecture of an intention recognition system 100 provided by an exemplary embodiment of the present application. Figure 1 As shown, the system 100 includes: a user terminal device 110 , an outbound calling device 120 and an intention recognition device 130 .

[0022] Taking the telemarketing scenario as an example, the user terminal device 110 can be a mobile phone, tablet, personal computer, personal digital assistant, or other device, enabling communication between the user and customer service. The customer service can be human or intelligent, and the outbound call device 120 can include a server or a landline phone. For example, the customer service can use the outbound call device 120 to call the user's phone, establish a communication connection with the user terminal device 110 via the network, and enable the user and customer service to communicate. The intent recognition device 130 can establish a communication connection with the outbound call device 120 via the network to monitor the conversation between the user and customer service in real time, retrieve keywords from the current sentence in the conversation, and locate contextual information containing the current sentence based on the keywords. Based on this contextual information, the intent recognition device 130 can also sequentially locate local textual information within the monitored conversation according to a preset step size and preset window size, and perform intent recognition on the local textual information. The intent recognition device 130 can provide real-time feedback to the customer service regarding the intent labels identified through these two methods, allowing the customer service to adjust their communication strategy based on the current intent labels. If the current intent labels are unreliable, the customer service can reconfirm the user's intent through methods such as counter-questions. At the end of the conversation, the intent recognition device 130 can obtain multiple intent tags corresponding to the entire conversation. Here, the intent recognition device 130 can be a computing device independent of the outbound call device 120, or a computing device integrated on the outbound call device 120.

[0023] In other scenarios, the outbound calling device 120 can also connect the call of the user terminal device 110 to establish a communication connection with the user terminal device 110, so that the user and the customer service can have a conversation. Optionally, the customer service and the user can have a conversation through voice or text.

[0024] It should be understood that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited thereto. On the contrary, the embodiments of the present application can be applied to any scenario that may be applicable.

[0025] Exemplary Methods

[0026] Figure 2 Shown is a flowchart of an intention recognition method provided by an exemplary embodiment of the present application. Figure 2 The method may be performed by a computing device (e.g., Figure 1 The intention recognition device 130, or other electronic devices) is executed. Figure 2 As shown, the intention recognition method includes the following contents.

[0027] 210: Determine whether a current sentence in the conversation contains a keyword in the keyword table based on the keyword table, wherein the keyword table includes multiple tags and at least one keyword corresponding to each tag, and a tag recall rate of each keyword in the keyword table is greater than or equal to a first preset threshold.

[0028] Specifically, the keyword table may include multiple tags and keywords corresponding to each tag, and each tag may correspond to one or more keywords. The tags in the keyword table may represent the intent corresponding to the keyword. For example, keywords can be extracted from a large number of historical conversation samples that have been labeled (such as intent tags), that is, the keywords correspond to the tags, and a keyword table can be constructed in this way.

[0029] Furthermore, in actual applications, some keywords may appear in conversations, which may indicate that the user wants to express the intention corresponding to the keyword in the keyword table, or the user may not want to express the intention corresponding to the keyword and simply use the keyword during the conversation. Therefore, each keyword corresponds to a certain tag recall rate, which is used to indicate the reliability of the keyword in recalling the tag corresponding to the keyword. Specifically, the tag recall rate of each keyword can be calculated when constructing the keyword corresponding to each tag in the keyword table.

[0030] For example, when constructing the keyword corresponding to label A in the keyword table, we can first collect historical conversation samples corresponding to label A. The total number of historical conversation samples corresponding to label A is N. One keyword corresponding to label A is keyword B. Keyword B appears in M ​​of the N historical conversation samples, so the label recall rate of keyword B is N / M. The higher the label recall rate corresponding to a keyword, the greater the likelihood that the intent expressed in the conversation content containing the keyword is consistent with the intent represented by the label corresponding to the keyword, that is, the more reliable the recall of the corresponding label for the keyword is.

[0031] Therefore, when constructing a keyword table, you can first determine the label recall rate of the keywords under each label, include keywords with label recall rates greater than or equal to the first preset threshold into the keyword table, and discard keywords with label recall rates less than the first preset threshold. In this way, you can obtain a keyword table with a high label recall rate.

[0032] If the current sentence in a conversation contains a keyword from the keyword list, it indicates that the user's intended meaning is likely to be expressed, and there's a high probability that this intention is the one represented by the tag corresponding to the keyword. Therefore, identifying user intent by determining whether the current sentence contains a keyword from the keyword list can improve intent recognition accuracy.

[0033] During the conversation between the user and the customer service, the sentence expressed by the user can be taken as the current sentence in turn, or each sentence in the conversation can be taken as the current sentence in turn. For the current sentence, it can be determined whether the current sentence contains the keywords in the keyword table. For example, the current sentence is segmented to obtain multiple words. For each word, the keywords in the keyword table can be traversed to determine whether the word matches a keyword in the keyword table. If there is a word in the current sentence that matches a keyword in the keyword table, that is, the word is a keyword in the keyword table, then it is determined that the current sentence contains the keyword in the keyword table. It should be understood that there may be no keyword in the current sentence, there may be one keyword, or there may be multiple keywords.

[0034] When the conversation is conducted in text form, the current sentence may be text information; when the conversation is conducted in voice form, the current sentence may be voice information, or text information converted from voice information.

[0035] 220: When the current sentence contains a keyword, determine the target label corresponding to the keyword, obtain context information containing the current sentence, input the context information into the first classification model, and obtain a first classification result. The first classification result is used to determine whether the intent label corresponding to the current sentence is the target label. When the intent label corresponding to the current sentence is the target label, the target label is used as the first intent label.

[0036] The length of the context information may meet a preset length requirement. For example, the context information may be obtained by concatenating K sentences before the current sentence, the current sentence, and L sentences after the current sentence, where K and L may be equal or different.

[0037] When there are keywords in the current sentence, it indicates that the current sentence is likely to contain the user's intention. Moreover, since the words in the current sentence are matched with the keywords in the keyword table through the strong matching method of keyword matching, the intention contained in the current sentence is consistent with the intention represented by the target tag corresponding to the matched keyword. Figure 1 To further verify whether the current sentence contains the intent represented by the target tag corresponding to the keyword, we can locate the context information containing the current sentence based on the keyword. Based on the context information of the current sentence, we can more accurately identify the user's intent.

[0038] For example, the context information is classified using a first classification model to obtain a classification result (first classification result). The classification result can indicate whether the intent tag corresponding to the context information is consistent with the target tag corresponding to the keyword. For example, the classification results include two types, one type corresponds to a specific intent tag, such as the target tag corresponding to the keyword, and the target tag can be output at this time; the other type is other, which means that the intent tag corresponding to the context information is not the target tag corresponding to the keyword, that is, no intent tag is obtained at this time. Optionally, the classification result may include yes or no. If yes, the target tag corresponding to the keyword is output as the intent tag; if no, the intent tag is not output.

[0039] The first classification model may be a BERT model or other natural language processing model.

[0040] 230: Positioning local text information in the conversation in sequence according to a preset step length and a preset window size.

[0041] The preset window size represents the length of a local text message, and the preset step size represents the length of the interval between two adjacent local text messages. For example, if the preset step size is 1, the preset window size is 3, and there are currently 6 sentences in the conversation, the four local text messages obtained are: sentence 1 + sentence 2 + sentence 3; sentence 2 + sentence 3 + sentence 4; sentence 3 + sentence 4 + sentence 5; and sentence 4 + sentence 5 + sentence 6. This method of sequentially locating local text messages in a conversation using a preset step size and a preset window size is called a sliding window enumeration method.

[0042] 240: When the first intent label includes a secondary label, the secondary label is determined to be a reference intent label, and the primary label and local text information to which the reference intent label belongs are input into the second classification model to obtain a second classification result. The second classification result includes the second intent label, and the scene type of the primary label corresponding to the second intent label is the same as the scene type of the primary label corresponding to the first intent label. The types of intent labels classified by the first classification model and the second classification model are different.

[0043] For each local text information, a second classification model can be used to classify it to obtain a classification result (second classification result). The first classification model and the second classification model can classify different types of intent labels. The second classification model can identify intent labels that cannot be recalled by keywords.

[0044] Similar to the first classification model, the second classification model can also be a BERT model or other natural language processing model.

[0045] The first intent label obtained by the first classification model can include a primary label, a secondary label, or a secondary label and the primary label corresponding to the secondary label. A primary label indicates that the label has no parent label and is therefore a parent label. A secondary label indicates that the label has a parent label and is therefore a child label. The parent label is equivalent to the parent label of the secondary label and can also be called the primary label of the secondary label. The same secondary label may correspond to the same primary label or different primary labels. For example, the primary label "renewal" corresponds to the secondary label "package options"; the primary label "consultation" corresponds to the secondary label "package options". Primary and secondary labels can be pre-set as needed. For example, bipolar labels that are recognized by the first and second classification models and have different scenario types can be pre-set. For example, the list of bipolar labels recognized by the first classification model may include the primary label "early repayment" and the corresponding secondary label "interest disapproval"; while the list of bipolar labels recognized by the second classification model may include the primary label "deferred repayment" and the corresponding secondary label "interest disapproval". The list of bipolar labels recognized by the first classification model may include the primary label "renewal" and the corresponding secondary label "package options". The list of two-pole labels that can be identified by the second classification model includes: the first-level label is consultation, and the corresponding second-level label is package option.

[0046] Since the intent labels obtained through keyword matching have a high accuracy rate, when the first intent label includes a secondary label, the secondary label can be determined as the reference intent label. The primary label corresponding to the reference intent label can be used as a reference for subsequent intent recognition of the local text information. For example, inputting the primary label corresponding to the reference intent label and the local text information into the second classification model to obtain the second intent label can avoid a conflict in the scene type between the primary label corresponding to the second intent label and the primary label corresponding to the first intent label, that is, preventing the second classification model from outputting an intent label that does not match the scene type involved in the conversation.

[0047] For example, the first-level tag corresponding to the second intent tag has the same scene type as the first-level tag corresponding to the first intent tag. That is, the specific content of the first-level tag corresponding to the second intent tag and the specific content of the first-level tag corresponding to the first intent tag may be different, but the scene type of the two is the same. The scene type corresponding to each first-level tag can be set in advance as needed.

[0048] Similar to the first intent tag, the second intent tag may include a primary tag, a secondary tag, or a secondary tag and a primary tag corresponding to the secondary tag.

[0049] 250: Use the first intent label and the second intent label as the intent labels of the conversation.

[0050] It should be understood that the first classification model can classify context information corresponding to different keywords; the second classification model can classify local text information containing different intentions.

[0051] In a conversation, the local text information corresponding to the second intent label can be located after the context information. For example, for a sentence before a certain local text information and / or a sentence located in the local text information, if no reference intent label is obtained, the local text information can be directly input into the second classification model to obtain the classification result. Optionally, the first intent labels in the entire conversation can be identified by keyword matching, and the reference intent labels can be determined based on these first intent labels, and then the intent of each local text information can be identified based on the reference intent labels to obtain the second intent label.

[0052] The first intent tag (target tag) and the second intent tag can be used as intent tags for the entire conversation.

[0053] An embodiment of the present application provides an intent recognition method, which determines whether the current sentence contains keywords in a keyword table based on a keyword table with a high label recall rate, and locates the context information of the current sentence when the keyword exists in the current sentence, and uses a first classification model to classify the context information to determine whether the intent label corresponding to the context information is the target label corresponding to the keyword. If so, the target label corresponding to the keyword is used as the first intent label of the current sentence, which can further improve the accuracy of intent recognition while ensuring a high recall rate. Moreover, determining the intent label by keyword matching can improve the efficiency of intent recognition, and classifying the identified intent labels by the first classification model can improve the accuracy of the recognition results while ensuring efficiency. Further, the local text information is located by a sliding window enumeration method, and when the first intent label includes a secondary label, the first-level label and the local text information corresponding to the first intent label are input into the second classification model to obtain a second intent label. This approach overcomes the shortcomings of intent recognition through keyword matching, identifying intents that keyword matching cannot, thus avoiding missed intent labels. It also prevents scenario type conflicts between the first-level label corresponding to the second intent label and the first-level label corresponding to the first intent label, thereby reducing the likelihood that the second classification model will output an intent label that does not match the scenario type involved in the conversation. Furthermore, through keyword matching and sliding window enumeration, recognized intent labels can be output in real time during the conversation between customer service and users, resulting in a multi-label combination of the conversation, which in turn facilitates communication strategy support for customer service during the conversation.

[0054] In an embodiment of the present application, the first classification model and the second classification model can classify different types of intent labels.

[0055] For example, when constructing a keyword table, there are keywords with high label recall rates under intent labels A and B, so a keyword table can be constructed based on intent label A and its corresponding keywords with high label recall rates, as well as intent label B and its corresponding keywords with high label recall rates. In this way, when executing the intent recognition method, keyword matching can be used to identify intent labels A and B, that is, the first classification model can be used to classify intent labels A and B. However, the label recall rates of the keywords corresponding to intent labels C and D are low, so intent labels C and D are not added to the keyword table. In order to identify intent labels C and D in text information when executing the intent recognition method, historical conversation samples related to intent labels C and D can be used to train the second classification model so that the second classification model can identify intent labels C and D.

[0056] In this embodiment, the intent tags corresponding to keywords with high tag recall rates can be identified by keyword matching. Since keyword matching can quickly locate context information, the efficiency and accuracy of intent recognition can be improved. The intent tags corresponding to keywords with low tag recall rates can be identified by a sliding window enumeration method, that is, the intent tags that cannot be identified by keyword matching can be identified by a sliding window enumeration method, which can avoid missing intent tags.

[0057] According to one embodiment of the present application, when the first intent tag includes a secondary tag, determining the secondary tag as a reference intent tag includes: when the first intent tag includes the secondary tag, obtaining a first representation vector corresponding to the context information; obtaining a second representation vector of the local text information; calculating the similarity value between the first representation vector and the second representation vector; and when the similarity value is greater than or equal to a second preset threshold, determining the secondary tag as a reference intent tag.

[0058] There may be multiple sentences containing keywords in a conversation. For each keyword, contextual information about the keyword can be obtained and input into the first classification model to obtain a first classification result. Therefore, at a certain stage in the conversation, there may be multiple first intent labels, including secondary labels.

[0059] In one example, multiple secondary tags corresponding to multiple first intent tags can all be determined as reference intent tags to obtain multiple reference intent tags. Multiple primary tags corresponding to the multiple reference intent tags are combined with local text information and input into a second classification model to obtain a second intent tag. The primary tags corresponding to the second intent tag do not conflict with the scene types of the multiple primary tags corresponding to the multiple reference intent tags, such as being the same.

[0060] Specifically, the second classification model can obtain the representation vectors of multiple first-level labels corresponding to multiple reference intent labels, as well as the representation vectors corresponding to local text information, and splice these representation vectors to obtain a spliced ​​representation vector, and then classify the spliced ​​representation vector to obtain a second classification result.

[0061] In another example, for each first intent tag including a secondary tag, the semantic similarity value between the context information corresponding to the first intent tag and the local text information can be calculated. When the semantic similarity value is greater than or equal to a second preset threshold, the secondary tag is determined as a reference intent tag. For example, a first representation vector corresponding to the context information and a second representation vector corresponding to the local text information can be obtained through an encoder. The similarity value between the first representation vector and the second representation vector is calculated, and when the similarity value is greater than or equal to the second preset threshold, the secondary tag is determined as a reference intent tag. Alternatively, the maximum similarity value among multiple similarity values ​​corresponding to multiple first intent tags (including secondary tags) can be determined, and the secondary tag corresponding to the maximum similarity value can be determined as the reference intent tag.

[0062] Specifically, the first-level label corresponding to the reference intent label is combined with the local text information and input into the second classification model to obtain the second intent label. For example, the first-level label corresponding to the reference intent label and the local text information can be input into the second classification model, and the second classification model can obtain the representation vectors of the first-level label and the local text information corresponding to the reference intent label, and splice these representation vectors to obtain a spliced ​​representation vector, and then classify the spliced ​​representation vector to obtain a second classification result. Optionally, an encoder can be used to obtain the representation vectors of the first-level label and the local text information corresponding to the reference intent label, and then these representation vectors can be input into the second classification model for splicing and classification to obtain a second classification result.

[0063] In this embodiment, for the first intent label including the secondary label, the semantic similarity between the context information and the local text information can be determined by calculating the similarity value between the representation vector of the context information corresponding to the first intent label and the representation vector corresponding to the local text information. When the similarity value is greater than or equal to the second preset threshold, it indicates that the semantic similarity between the context information and the local text information is high, and the scene types of the first-level labels corresponding to the two should be the same. Therefore, when the similarity value is greater than or equal to the second preset threshold, the second-level label is determined to be the reference intent label, and the first-level label and the local text information corresponding to the reference intent label are input into the second classification model to obtain the second intent label, which can reduce the possibility that the second intent label is inconsistent with the scene type involved in the conversation and improve the accuracy of the second intent label.

[0064] According to one embodiment of the present application, the local text information is the text information in the complete text information of the conversation excluding the context information of the current sentence; the first-level label to which the reference intention label belongs and the local text information are input into the second classification model to obtain a second classification result, including: obtaining a third representation vector of the first-level label to which the reference intention label belongs; inputting the third representation vector and the second representation vector into the second classification model; using the second classification model to splice the third representation vector and the second representation vector to obtain a spliced ​​representation vector; classifying the spliced ​​representation vector to obtain a reference classification result; obtaining the emotion recognition information of the user in the conversation for the reference classification result, and if the emotion recognition information is a positive emotion, determining the reference classification result as the second classification result.

[0065] The local text information is the text information in the complete text information of the conversation except the context information of the current sentence. For example, in the complete text information of the conversation, the context information may be located before or after the local text information.

[0066] The second classification model may include an encoding network and a classification network.

[0067] In one example, the primary label and local text information associated with the reference intent label can be input into a second classification model. The encoding network can then be used to obtain a third representation vector for the primary label corresponding to the reference intent label, as well as a second representation vector corresponding to the local text information. Furthermore, the encoding network can be used to concatenate the third representation vector and the second representation vector to obtain a concatenated representation vector. The concatenated representation vector is then classified using a classification network to obtain a reference classification result. The reference classification result includes the corresponding intent label.

[0068] In another example, the third representation vector of the first-level label corresponding to the reference intent label and the second representation vector corresponding to the local text information can be obtained through the encoder. The third representation vector and the second representation vector are input into the second classification model, and the third representation vector and the second representation vector are spliced ​​by the encoding network of the second classification model to obtain a spliced ​​representation vector, and the spliced ​​representation vector is classified by the classification network of the second classification model to obtain a reference classification result. The encoder in the embodiment of the present application can be the encoding network in the first classification model, the encoding network in the second classification model, or other natural language processing models.

[0069] In one example, the reference classification result may be directly determined as the second classification result, and the intent label corresponding to the reference classification result may be the second intent label.

[0070] In another example, emotion recognition information of the user in the conversation regarding the reference classification result can be obtained. The emotion recognition information can be information about the user's response to the customer service's question. For example, after the second classification model outputs the reference classification result, the customer can further confirm with the user whether the intention corresponding to the reference classification result is the intention truly expressed by the user. The customer service can confirm with the user by asking a question, and the user's response information to the question is emotion recognition information. This emotion recognition information can be input into the emotion recognition model. The emotion recognition model can output two results, one positive emotion and one negative emotion. For example, if the user's response is "Yes, that's what I meant," the emotion recognition model outputs a positive emotion; if the user's response is "No, that's not what I meant," the emotion recognition model outputs a negative emotion. If the emotion recognition information is positive, the reference classification result can be determined as the second classification result. The emotion recognition model can be another model independent of the second classification model, or it can be part of the second classification model.

[0071] In this embodiment, the accuracy of the second intent label can be improved by combining the third representation vector of the primary label to which the reference intent label belongs with the second representation vector of the local text information to perform intent recognition on the local text information. Furthermore, the accuracy of the second intent label can be further improved by obtaining and analyzing emotion recognition information and, if the emotion recognition information indicates a positive emotion, determining the reference classification result as the second classification result.

[0072] According to an embodiment of the present application, context information including the current sentence is obtained and the context information is input into a first classification model to obtain a first classification result, including: using the first classification model to obtain a first representation vector of the context information; classifying the first representation vector to obtain a first classification result, the first classification result including a first probability that the first representation vector belongs to a target label and a second probability that the first representation vector belongs to other labels, when the first probability is greater than or equal to a third preset threshold, it indicates that the intention label corresponding to the current sentence is consistent with the target label.

[0073] The first classification model may include an encoding network and a classification network. After the context information is input into the first classification model, the first representation vector corresponding to the context information can be obtained through the encoding network, and the first representation vector can be classified using the classification network to obtain a first classification result. The first classification result includes a first probability that the first representation vector belongs to the target label and a second probability that the first representation vector belongs to other labels. When the first probability is greater than or equal to the third preset threshold, it indicates that the intent label corresponding to the current sentence is consistent with the target label, and the target label can be used as the first intent label; when the first probability is less than the third preset threshold, it indicates that the intent label corresponding to the current sentence is inconsistent with the target label, and the intent label corresponding to the current sentence may be an intent label other than the target label, or the current sentence does not contain intent. Therefore, when the first probability is less than the third preset threshold, the intent label for the current sentence may not be output.

[0074] The third preset threshold may be 0.5, 0.6 or other values, and the specific value may be set according to actual needs.

[0075] In this embodiment, after determining the target label corresponding to the current sentence by keyword matching, the first classification model can be used to classify the context information of the current sentence to further confirm whether the intention label of the current sentence containing the keyword is the target label, thereby improving the accuracy of intent recognition.

[0076] According to one embodiment of the present application, the first classification model is obtained by training a data set containing positive examples and negative examples, the positive example includes a first sample and an annotated label of the first sample, the first sample includes a keyword, and the annotated label of the first sample is consistent with the label corresponding to the keyword, and the negative example includes a second text and an annotated label of the second text, the second text includes a keyword, and the annotated label of the second text is inconsistent with the label corresponding to the keyword. The first classification result includes a target label corresponding to the keyword and other labels, and the other labels are used to indicate that the first classification result is inconsistent with the label corresponding to the keyword. In the case where the first classification result is the target label corresponding to the keyword, the target label corresponding to the keyword is determined as the first intent label.

[0077] Specifically, the dataset used to train the first classification model includes positive and negative examples. Both positive and negative examples are samples containing keywords. The samples can be text information that meets a preset length requirement, and the keywords can be keywords from a keyword table. Before training the first classification model, the samples can be annotated with intent to obtain annotation labels, which can be either manual or machine-annotated.

[0078] The label of the positive sample (the first sample) is consistent with the label corresponding to the keyword, that is, the intention contained in the text information containing the keyword is consistent with the intention represented by the label corresponding to the keyword. Figure 1The negative sample (the second sample) has a different label than the keyword. That is, the intent of the text containing the keyword is inconsistent with the intent represented by the keyword's label. For example, the historical conversation samples used in the keyword table construction process can be used as the dataset for training the first classification model.

[0079] The first classification model is trained using positive samples and negative samples so that the first classification model can classify context information containing keywords to confirm whether the intent label corresponding to the context information is consistent with the target label corresponding to the keyword.

[0080] Different positive and negative examples can be constructed for different keywords. These examples can then be used to train the first classification model, enabling it to classify contextual information containing different keywords. Furthermore, the keyword table can be adjusted to accommodate different application scenarios, establishing different correspondences between labels and keywords.

[0081] In this embodiment, positive and negative examples are constructed using text information containing keywords, and the first classification model is trained using the positive and negative examples, so that the trained first classification model can further confirm the intent label of the context information containing keywords during the intent recognition process, thereby improving the accuracy of intent recognition.

[0082] According to an embodiment of the present application, the intention recognition method also includes: determining at least one historical conversation sample corresponding to each tag in a plurality of tags included in the keyword table; extracting candidate keywords from at least one historical conversation text for each tag; determining the number of samples in which the candidate keyword appears in at least one historical conversation sample; determining the ratio between the number of samples and the total number of at least one historical conversation sample as the tag recall rate of the candidate keyword; when the tag recall rate of the candidate keyword is greater than or equal to a first preset threshold, using the candidate keyword as the keyword corresponding to the tag, and constructing a keyword table based on multiple tags and at least one keyword corresponding to each tag.

[0083] Specifically, when constructing a keyword table, one or more historical conversation samples corresponding to each label can be collected. The historical conversation samples can be text information that meets the preset length requirements selected from the historical conversation data. For example, the length of the historical conversation sample can be consistent with the length of the context information input into the first classification model. For each label, candidate keywords can be extracted from multiple historical conversation samples corresponding to the label. The number of candidate keywords can be one or more. For each candidate keyword, the number of samples in which the candidate keyword appears in multiple historical conversation samples can be counted. If the number of samples in which the candidate keyword appears is greater, it indicates that the candidate keyword has a high degree of association with the label. In other words, if the text to be identified contains the candidate keyword, the intention contained in the text to be identified is consistent with the intention represented by the label. Figure 1 The likelihood of a coincidence is high, that is, the recall rate of the candidate keyword for the tag is high. Therefore, the ratio between the number of samples in which the candidate keyword appears in multiple historical conversation samples and the total number of historical conversation samples can be calculated and the ratio can be determined as the tag recall rate of the candidate keyword.

[0084] In order to obtain keywords with high tag recall rates to construct a keyword table, multiple candidate keywords can be screened. For example, a first preset threshold can be set according to the specific application scenario, and candidate keywords with tag recall rates greater than or equal to the first preset threshold are retained as keywords corresponding to the tags in the keyword table.

[0085] For example, in telesales scenarios, users may report intents to customer service, including "staff attitude is bad," "deregister account," and "stop calling." For the intent label "staff attitude is bad," the local context in historical conversations contains keywords such as "attitude" and "tone." These keywords have high recall rates in conversations corresponding to the intent label "staff attitude is bad." Therefore, we can add "attitude" and "tone" to the keyword table as keywords corresponding to the intent label "staff attitude is bad." Based on this principle, we can construct keywords for all intent labels, ultimately creating a keyword vocabulary.

[0086] In this embodiment, by selecting keywords with high tag recall rates from multiple historical conversation samples corresponding to a tag as the keywords corresponding to the tag, and constructing a keyword table based on the tags and the keywords, the accuracy of subsequent intent recognition based on the keyword table can be improved, thereby increasing the reliability of the recognition results. In addition, intent recognition through keyword matching can improve the efficiency of intent recognition, which is conducive to providing customer service with high-accuracy intent tags in real time during the conversation between customer service and users, facilitating customer service to understand user psychology and promoting communication between customer service and users.

[0087] According to one embodiment of the present application, the intention recognition method also includes: when the current sentence contains keywords, updating the next sentence of the context information to the current sentence; when the current sentence does not contain keywords, updating the next sentence of the current sentence to the current sentence.

[0088] Specifically, when the current sentence contains keywords, the context information of the current sentence can be analyzed, such as inputting the context information into the first classification model, and then the next sentence of the context information can be updated to the current sentence. The next sentence of the context information can be a sentence expressed by the user or a sentence expressed by customer service. Repeatedly determine whether the current sentence contains keywords in the keyword table. If so, locate the context information of the current sentence again and analyze the context information. By iterating in this way, the intention expressed by the user can be identified in real time during the conversation. Since the context information has been analyzed, keyword matching of the sentence after the context information can improve the efficiency of intent recognition.

[0089] When the current sentence does not contain keywords, the next sentence of the current sentence can be updated to the current sentence. The next sentence of the current sentence can be a sentence expressed by the user or a sentence expressed by customer service. When the current sentence does not contain keywords in the keyword table, it may be that the current sentence is a casual chat, so it does not contain keywords; it may also be that the words in the current sentence belong to keywords with low label recall rates, so it is difficult to match them with keywords in the keyword table, but at this time the current sentence may contain user intent. Although the intent label corresponding to the current sentence is not recalled by keyword matching, the intent label corresponding to the current sentence can be recalled by the sliding window enumeration method in the embodiment of the present application.

[0090] Therefore, the embodiment of the present application can ensure efficient and high-accuracy recognition of some intent tags through keyword matching, and can also avoid missing intent tags that cannot be identified by keyword matching through sliding window enumeration.

[0091] Optionally, when the current sentence contains keywords, the next sentence of the current sentence can also be updated to the current sentence, which can further improve the comprehensiveness of intent label recognition and avoid missing intent labels.

[0092] According to one embodiment of the present application, the intent recognition method also includes: when the first intent label does not include a secondary label, inputting the local text information into the second classification model to obtain a third classification result, the third classification result includes a third intent label and a score of the third intent label; when the score of the third intent label is greater than or equal to a fourth preset threshold, using the first intent label and the third intent label as intent labels for the conversation, wherein the fourth preset threshold is used to indicate the reliability of the third intent label.

[0093] When the first intent label does not include a second-level label, it indicates that the first intent label only includes a first-level label, and the first-level label has no sub-label, that is, the first-level label does not involve a situation where the scene type is different from other first-level labels (such as conflict). In this case, the local text information can be directly input into the second classification model to obtain the third classification result.

[0094] Specifically, the second classification model can be trained using labeled text information of a certain length so that the second classification model can classify the local text information and obtain the intent label corresponding to the local text information. The length of the text information used to train the second classification model can be the same as the length of the local text information.

[0095] In one example, the third classification result output by the second classification model may be a third intent label, and the third intent label may be stored as a final intent label.

[0096] In another example, the third classification result output by the second classification model can be the third intent label and the score of the third intent label, that is, the reliability of the third intent label needs to be determined based on the score. For example, there are multiple intent labels that can be identified by the second classification model, and a preset threshold (fourth preset threshold) can be set for each intent label. The preset threshold can be used to characterize the reliability of the intent label recognition, or the degree of difficulty. The smaller the fourth preset threshold, the more difficult it is to identify the intent label. Therefore, according to actual conditions, a threshold can be set for each intent label that can be identified by the second classification model. Alternatively, the preset threshold corresponding to each intent label can be determined based on the data during the training process of the second classification model, for example, the fourth preset threshold is obtained through multi-threshold training. Specifically, on the validation set, according to the importance of business indicators, such as the business requirements for accuracy, the model is continuously trained to optimize the accuracy of each category on the validation set. After the training is completed, the local optimal threshold for each label is obtained, that is, the fourth preset threshold is obtained.

[0097] When the second classification model outputs an intent label and an intent label score, the output intent label can be considered a pending intent label. The score of the pending intent label is compared with the preset threshold corresponding to the pending intent label. If the score is greater than or equal to the preset threshold, the pending intent label can be considered a reliable intent label and stored. If the score is less than the preset threshold, the pending intent label can be considered an unreliable intent label and discarded. For example, the second classification model outputs an intent label score of 0.7, and the preset threshold corresponding to the intent label is 0.5. Since 0.7 is greater than 0.5, the intent label is a reliable intent label and can be used as the intent label for the conversation.

[0098] In this embodiment, by determining in advance the threshold of each intent label that can be recognized by the second classification model, when the second classification model obtains the intent label and the score corresponding to the intent label, it is determined whether the score of the intent label is greater than or equal to the corresponding threshold. If it is greater than or equal to the threshold, the intent label is determined as the intent label of the local text information, otherwise it can be discarded. In this way, the reliability of the final intent label can be improved.

[0099] According to one embodiment of the present application, the intention recognition method also includes: inputting the user's response information to the question corresponding to the first intention label, the second intention label and / or the third intention label in the conversation into the emotion recognition model to obtain a recognition result; when the recognition result is positive, determining the first intention label, the second intention label and / or the third intention label as the target intention label.

[0100] Specifically, the computing device can present the intent label obtained based on the first classification model and / or the intent label obtained based on the second classification model to the customer service, so that the customer service can further confirm with the user whether the intent corresponding to the obtained intent label is the user's true intention. For example, the customer service can ask the user a question based on the intention corresponding to the obtained intent label, and the computing device can determine whether the intent label is the target intent label based on the user's response information to the question corresponding to the intent label, that is, whether it is the intent label corresponding to the conversation. If the user's answer is affirmative, the intent label is the target intent label. If the user's answer is negative, the intent label is not the target intent label and can be discarded.

[0101] In actual application scenarios, there may be issues such as users not being direct or clear enough in certain statements, or the classification model itself being too inaccurate. These issues can result in inaccurate intent labels output by the classification model. In this embodiment, by further confirming the reliability of the intent label with the user, the accuracy and reliability of the target intent label can be improved.

[0102] For example, an emotion recognition model can be used to identify the user's response information to obtain a recognition result. When the recognition result is positive, the first intention label, the second intention label and / or the third intention label are determined to be the target intention label. Specifically, the training samples of the emotion recognition model can be general expressions of "affirmation" (affirmative data samples) and general expressions of "negation" (negative data samples). For example, the affirmative data sample is "Yes, that's what I mean", and such a sample can be classified as a positive example; the negative data sample is "No, that's not what I mean", and such a sample can be classified as a negative example. An emotion recognition model can be obtained by constructing positive and negative example data sets to train the model.

[0103] In one scenario, the classification model (either the first or second classification model) outputs the intent label "cancel account." Customer service deems this intent label unreliable and can further confirm the accuracy of the intent label with the user. For example, customer service can ask the user, "Are you sure you want to cancel your account?" and then use the emotion recognition model to determine the sentiment of the user's response and output a "yes" or "no." If the emotion recognition model outputs "yes," it indicates that "cancel account" is the target intent label; if the emotion recognition model outputs "no," it indicates that "cancel account" is not the target intent label and can be discarded.

[0104] Since there are many ways to express "affirmation" and "negation", in this embodiment, the emotion recognition model is used to identify whether the user's response information is an affirmative answer or a negative answer, which can improve the accuracy of identifying the user's affirmative and negative emotions, and thus improve the reliability of the obtained target intention label.

[0105] According to one embodiment of the present application, after the first intent label and the second intent label are used as the intent labels of the conversation, the intent recognition method further includes: obtaining the complete text information of the conversation, wherein the length of the complete text information is greater than or equal to a fifth preset threshold; inputting the complete text information into a long text multi-intent recognition model to obtain a long text intent label; and using the first intent label, the second intent label, and the long text intent label as the intent labels of the conversation.

[0106] After the conversation ends, the entire content of the conversation (complete text information) can be input into the long text multi-intent recognition model, which can identify intents spanning a large length in the complete text information.

[0107] Specifically, the context information located by keywords and the local text information located by sliding window enumeration are both local content in the entire conversation, so these two methods cannot cover the intent labels that span long distances in the text information. That is, the above two methods cannot identify the intent labels that need to be obtained based on long-distance text information. In order to avoid missing intent labels that span long distances in text information, the long text multi-intent recognition model can be used to perform intent recognition on the complete text information after the conversation is completed to obtain the long text intent label. The long text intent labels identified by the long text multi-intent recognition model can be zero, one or more, depending on the number of intents that span long distances actually contained in the complete text information to be identified.

[0108] For example, the user states the repayment date at the beginning of the conversation, with many sentences in between, and finally asks the customer service to "change the repayment date". For this kind of intent label that spans a long length to be recognized, the above-mentioned method of intent recognition based on contextual information located by keyword (which can be regarded as task one) and the method of intent recognition based on local text information located by sliding window enumeration (which can be regarded as task two) cannot cover this scenario. Therefore, the long text multi-intent recognition model can be used to analyze the complete text information of the entire conversation to obtain the long text intent label "change repayment date".

[0109] The long text multi-intent recognition model can be obtained by training the model using multiple historical complete conversation samples. The length of the historical complete conversation samples can be greater than or equal to the fifth preset threshold. In this way, the trained long text multi-intent recognition model can recognize the intent of long text information whose length is greater than or equal to the fifth preset threshold. Multiple historical complete conversation samples can be labeled with different intent labels. In this way, the trained long text multi-intent recognition model can recognize the intent of long text information containing different intents. For example, the long text multi-intent recognition model can be a Longformer or other natural language processing model.

[0110] In this embodiment, the long text multi-intent recognition model is used to perform intent recognition on the complete text information obtained after the conversation ends, so that intent labels across long distances can be obtained, the label recall rate of long text information can be improved, and the omission of intent labels can be avoided.

[0111] In some embodiments, when local text information precedes a current sentence containing a first intent label, only the local text information can be input into the second classification model to obtain the corresponding intent label. After the conversation ends, all obtained intent labels can be further evaluated to determine whether there are any conflicting intent labels. If so, the intent label corresponding to the local text information can be discarded, and the intent label obtained through keyword matching can be retained. This can improve the overall accuracy of all the intent labels obtained.

[0112] For example, the intent label in the embodiment of the present application may be a two-level label with a label depth of 2. The first-level label may represent the scenario where the user's problem is located; the second-level label may represent the specific intention under the corresponding scenario. Based on the first-level label, it can be directly judged whether the two intent labels are contradictory. For example, the first-level label of the intent label obtained in Task 1 is "early repayment", and the first-level label of the intent label obtained in Task 2 is "deferred repayment". These two scenarios are contradictory, so the second intent label "deferred repayment" can be discarded and "early repayment" can be retained. The contradictory intent labels in this embodiment can be set in advance according to the actual scenario.

[0113] Figure 3Shown is a flowchart of an intention recognition method provided by another exemplary embodiment of the present application. Figure 3 The embodiment is Figure 2 For the example of embodiment, in order to avoid repetition, the same points can be referred to the description in the above embodiment, which will not be repeated here. Figure 3 As shown, the intention recognition method includes the following contents.

[0114] 300: Receive conversation information.

[0115] Specifically, the sentences expressed by the user and the customer service can be received in real time.

[0116] 310: Determine, based on the keyword table, whether the current sentence in the conversation contains a keyword in the keyword table.

[0117] The keyword table includes multiple tags and at least one keyword corresponding to each tag. The tag recall rate of each keyword in the keyword table is greater than or equal to a first preset threshold. The tag recall rate is used to indicate the reliability of each keyword in recalling the tag corresponding to each keyword.

[0118] If the current sentence contains a keyword in the keyword table, step 320 is executed; otherwise, step 350 is executed.

[0119] 320: Locate the context information of the current sentence based on the keywords.

[0120] 330: Classify the context information using the first classification model to obtain a first classification result, and when the first classification result is a target tag corresponding to the keyword, output the target tag as a first intent tag in real time.

[0121] If the context information meets the preset length requirement, the first classification result indicates whether the intent tag corresponding to the context information is consistent with the target tag corresponding to the keyword. For example, the first classification result may be a target tag, which can be used as the first intent tag; or the first classification result may be another tag, indicating that the intent tag corresponding to the context information is inconsistent with the target tag corresponding to the keyword. In this case, no tag may be output based on the first classification result.

[0122] Specifically, if the customer service believes that the accuracy of the first intent label is not high, they can ask the user a question in return. The user's response to the question is input into the emotion recognition model to confirm whether the first intent label is reliable. If so, it is retained; otherwise, it can be discarded.

[0123] 340: Update the next sentence of the context information to the current sentence.

[0124] Repeat step 310.

[0125] 350: Update the next sentence of the current sentence to the current sentence.

[0126] Repeat step 310.

[0127] 360: Positions the local text information in the conversation in sequence according to the preset step size and preset window size.

[0128] 370: When the first intent label includes a secondary label, the secondary label is determined to be a reference intent label, and the primary label and local text information to which the reference intent label belongs are input into the second classification model. When the first intent label does not include a secondary label, the local text information is input into the second classification model, and the second classification model outputs a pending intent label and a score corresponding to the pending intent label.

[0129] Specifically, when the first intent label is identified before the local text information, and when the first intent label includes a secondary label, the secondary label is determined to be a reference intent label, and the primary label and the local text information to which the reference intent label belongs are input into the second classification model; when the first intent label does not include a secondary label, the local text information is input into the second classification model. When the first intent label is not identified before the local text information, the local text information is input into the second classification model. The output of the second classification model includes the pending intent label and the score corresponding to the pending intent label. The determination process of the reference intent label and the classification process of the second classification model can be found in the description in the above embodiment.

[0130] 380: Determine whether the score corresponding to the pending intent label is greater than or equal to a preset threshold.

[0131] If the score corresponding to the pending intention label is greater than or equal to the preset threshold, step 390 is executed; otherwise, step 360 is repeated.

[0132] 390: Output pending intent labels in real time.

[0133] Specifically, when customer service deems the pending intent label to be inaccurate, they can ask the user a question. The user's response to the question is fed into the emotion recognition model to confirm whether the pending intent label is reliable. If so, it is retained; otherwise, it is discarded.

[0134] 391:At the end of the conversation, the complete text information is input into the long text multi-intent recognition model to obtain the long text intent label.

[0135] Steps 310-350 can be regarded as task one, and steps 360-390 can be regarded as task two. Both tasks are performed continuously as the conversation progresses. When the current sentence is the last sentence in the conversation, the intent recognition process of the above task one can be ended; when the local text information already contains the last sentence in the conversation, the intent recognition process of the above task two can be ended. The intent labels output by tasks one and two and the intent labels output by the long text multi-intent recognition model are summarized and passed to downstream businesses. Furthermore, in the telemarketing scenario, the multiple intent labels outputted in the summary can be verified by manual customer service to determine whether these labels should be applied to the final work order. For example, manual customer service can adjust the summarized intent labels based on actual conditions.

[0136] Exemplary devices

[0137] Figure 4 FIG. 4 is a schematic diagram of the structure of an intention recognition device 400 provided by an exemplary embodiment of the present application. Figure 4 As shown, the intention recognition device 400 includes: a determination module 410 , a first classification module 420 and a second classification module 430 .

[0138] The determination module 410 is used to determine whether the current sentence in the conversation contains a keyword in the keyword table based on the keyword table, wherein the keyword table includes multiple tags and at least one keyword corresponding to each tag, and the tag recall rate of each keyword in the keyword table is greater than or equal to a first preset threshold; the first classification module 420 is used to determine the target tag corresponding to the keyword when the current sentence contains the keyword, and obtain the context information containing the current sentence, input the context information into the first classification model, and obtain the first classification result. The first classification result is used to determine whether the intention tag corresponding to the current sentence is the target tag. When the intention tag corresponding to the current sentence is the target tag, the target tag is used as A first intention label; a second classification module 430, which is used to locate the local text information in the conversation in sequence according to a preset step size and a preset window size, and when the first intention label includes a secondary label, determine the secondary label as a reference intention label, and input the primary label and local text information belonging to the reference intention label into the second classification model to obtain a second classification result, the second classification result includes the second intention label, and the scene type of the first label corresponding to the second intention label is the same as the scene type of the first label corresponding to the first intention label, and the types of intent labels classified by the first classification model and the second classification model are different; the determination module 410 is also used to use the first intention label and the second intention label as intent labels for the conversation.

[0139] An embodiment of the present application provides an intent recognition device, which determines whether the current sentence contains keywords in a keyword table based on a keyword table with a high label recall rate, and locates the context information of the current sentence when the keyword exists in the current sentence, and uses a first classification model to classify the context information to determine whether the intent label corresponding to the context information is the target label corresponding to the keyword. If so, the target label corresponding to the keyword is used as the first intent label of the current sentence, which can further improve the accuracy of intent recognition while ensuring a high recall rate. Moreover, determining the intent label by keyword matching can improve the efficiency of intent recognition, and classifying the identified intent labels by the first classification model can improve the accuracy of the recognition results while ensuring efficiency. Further, the local text information is located by a sliding window enumeration method, and when the first intent label includes a secondary label, the primary label and the local text information corresponding to the first intent label are input into the second classification model to obtain a second intent label. This approach overcomes the shortcomings of intent recognition through keyword matching, identifying intents that keyword matching cannot, thus avoiding missed intent labels. It also prevents scenario type conflicts between the first-level label corresponding to the second intent label and the first-level label corresponding to the first intent label, thereby reducing the likelihood that the second classification model will output an intent label that does not match the scenario type involved in the conversation. Furthermore, through keyword matching and sliding window enumeration, recognized intent labels can be output in real time during the conversation between customer service and users, resulting in a multi-label combination of the conversation, which in turn facilitates communication strategy support for customer service during the conversation.

[0140] According to one embodiment of the present application, the second classification module 430 is used to: obtain a first representation vector corresponding to the context information when the first intent label includes a secondary label; obtain a second representation vector corresponding to the local text information; calculate the similarity value between the first representation vector and the second representation vector; and determine the secondary label as a reference intent label when the similarity value is greater than or equal to a second preset threshold.

[0141] According to one embodiment of the present application, local text information is text information other than the context information of the current sentence in the complete text information of the conversation, and the second classification module 430 is used to: obtain a third representation vector of the first-level label to which the reference intention label belongs; input the third representation vector and the second representation vector into the second classification model; use the second classification model to splice the third representation vector and the second representation vector to obtain a spliced ​​representation vector; classify the spliced ​​representation vector to obtain a reference classification result; obtain emotion recognition information of the user in the conversation for the reference classification result, and if the emotion recognition information is a positive emotion, determine the reference classification result as the second classification result.

[0142] According to one embodiment of the present application, the first classification module 420 is used to: obtain a first representation vector of context information using a first classification model; classify the first representation vector to obtain a first classification result, the first classification result including a first probability that the first representation vector belongs to a target label and a second probability that the first representation vector belongs to other labels. When the first probability is greater than or equal to a third preset threshold, it indicates that the intention label corresponding to the current sentence is consistent with the target label.

[0143] According to an embodiment of the present application, the intention recognition device 400 also includes a construction module, which is used to: determine at least one historical conversation sample corresponding to each tag in the multiple tags included in the keyword table; extract candidate keywords from at least one historical conversation text for each tag; determine the number of samples in which the candidate keyword appears in at least one historical conversation sample; determine the ratio between the number of samples and the total number of at least one historical conversation sample as the tag recall rate of the candidate keyword; when the tag recall rate of the candidate keyword is greater than or equal to a first preset threshold, use the candidate keyword as the keyword corresponding to the tag, and construct a keyword table based on multiple tags and at least one keyword corresponding to each tag.

[0144] According to one embodiment of the present application, second classification module 430 is further configured to: if the first intent label does not include a secondary label, input the local text information into the second classification model to obtain a third classification result, wherein the third classification result includes a third intent label and a score for the third intent label. Determination module 410 is further configured to: if the score of the third intent label is greater than or equal to a fourth preset threshold, use the first intent label and the third intent label as intent labels for the conversation, wherein the fourth preset threshold is used to indicate the reliability of the third intent label.

[0145] According to one embodiment of the present application, intent recognition apparatus 400 further includes an acquisition module. After using the first and second intent labels as intent labels for the conversation, the acquisition module is configured to: obtain the complete text information of the conversation, where the length of the complete text information is greater than or equal to a fifth preset threshold; and input the complete text information into a long text multi-intent recognition model to obtain a long text intent label. Determination module 410 is configured to use the first, second, and long text intent labels as intent labels for the conversation.

[0146] It should be understood that the operations and functions of the determination module 410, the first classification module 420, the second classification module 430, the construction module and the acquisition module in the above embodiment can refer to the above Figure 2 or Figure 3 To avoid repetition, the description of the intention recognition method provided in the embodiment will not be repeated here.

[0147] Figure 5FIG2 is a block diagram of an electronic device 500 for executing an intention recognition method provided by an exemplary embodiment of the present application.

[0148] Reference Figure 5 Electronic device 500 includes a processor 510 and a memory resource represented by memory 520 for storing instructions executable by processor 510, such as applications. The applications stored in memory 520 may include one or more modules, each corresponding to a set of instructions. Furthermore, processor 510 is configured to execute the instructions to perform the above-described intent recognition method.

[0149] The electronic device 500 may further include a power supply component configured to perform power management of the electronic device 500, a wired or wireless network interface configured to connect the electronic device 500 to a network, and an input / output (I / O) interface 530. The electronic device 500 may be operated based on an operating system stored in the memory 520, such as Windows Server 2008. TM , MacOS X TM , Unix TM , Linux TM , FreeBSD TM or similar.

[0150] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by the processor of the above-mentioned electronic device 500, enables the above-mentioned electronic device 500 to perform an intention recognition method.

[0151] All of the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, and will not be described in detail here.

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

[0153] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0154] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0155] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0156] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0157] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program check codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0158] It should be noted that, in the description of this application, the terms "first," "second," "third," etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

[0159] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for identifying intention, characterized in that: include: Determining, based on a keyword table, whether a current sentence in a conversation contains a keyword in the keyword table, wherein the keyword table includes a plurality of tags and at least one keyword corresponding to each tag, and a tag recall rate of each keyword in the keyword table is greater than or equal to a first preset threshold; If the current sentence contains the keyword, determine a target label corresponding to the keyword, obtain context information containing the current sentence, input the context information into a first classification model, and obtain a first classification result. The first classification result is used to determine whether the intent label corresponding to the current sentence is the target label. If the intent label corresponding to the current sentence is the target label, use the target label as the first intent label. sequentially locating the local text information in the conversation according to a preset step length and a preset window size; In a case where the first intent label includes a secondary label, determining the secondary label as a reference intent label, inputting the primary label to which the reference intent label belongs and the local text information into a second classification model to obtain a second classification result, wherein the second classification result includes a second intent label, and the primary label corresponding to the second intent label and the primary label corresponding to the first intent label have the same scene type, and the first classification model and the second classification model classify different intent labels into different types; The first intent tag and the second intent tag are used as intent tags of the conversation.

2. The intention recognition method according to claim 1, characterized in that In the case where the first intent tag includes a secondary tag, determining the secondary tag as a reference intent tag includes: In a case where the first intent label includes a secondary label, obtaining a first representation vector corresponding to the context information; Obtaining a second representation vector of the local text information; Calculating a similarity value between the first representation vector and the second representation vector; When the similarity value is greater than or equal to a second preset threshold, the secondary tag is determined as the reference intention tag.

3. The intention recognition method according to claim 2, characterized in that The local text information is text information in the complete text information of the conversation excluding the context information of the current sentence; the first-level label to which the reference intent label belongs and the local text information are input into the second classification model to obtain a second classification result, including: Obtaining a third representation vector of the first-level label to which the reference intent label belongs; inputting the third representation vector and the second representation vector into the second classification model; Using the second classification model, concatenate the third representation vector and the second representation vector to obtain a concatenated representation vector; classifying the concatenated representation vector to obtain a reference classification result; Emotion recognition information of the user in the conversation with respect to the reference classification result is obtained, and if the emotion recognition information is a positive emotion, the reference classification result is determined as a second classification result.

4. The intention recognition method according to claim 1, characterized in that The acquiring of context information including the current sentence and inputting the context information into a first classification model to obtain a first classification result includes: Obtaining a first representation vector of the context information using the first classification model; The first representation vector is classified to obtain the first classification result, where the first classification result includes a first probability that the first representation vector belongs to the target label and a second probability that the first representation vector belongs to other labels. When the first probability is greater than or equal to a third preset threshold, it indicates that the intention label corresponding to the current sentence is consistent with the target label.

5. The intention recognition method according to claim 1, characterized in that: The method further comprises: Determining at least one historical conversation sample corresponding to each tag among a plurality of tags included in the keyword table; For each tag, extracting candidate keywords from the at least one historical conversation text; Determining the number of samples in which the candidate keyword appears in the at least one historical conversation sample; Determining a ratio between the number of samples and the total number of the at least one historical conversation sample as a tag recall rate of the candidate keyword; When the tag recall rate of the candidate keyword is greater than or equal to the first preset threshold, the candidate keyword is used as the keyword corresponding to the tag, and the keyword table is constructed according to the multiple tags and at least one keyword corresponding to each tag.

6. The intention recognition method according to claim 1, characterized in that: The method further comprises: In a case where the first intent label does not include a secondary label, inputting the local text information into a second classification model to obtain a third classification result, the third classification result including a third intent label and a score of the third intent label; When the score of the third intent label is greater than or equal to a fourth preset threshold, the first intent label and the third intent label are used as intent labels for the conversation, wherein the fourth preset threshold is used to indicate the reliability of the third intent label.

7. The intention recognition method according to any one of claims 1 to 6, characterized in that: After using the first intent tag and the second intent tag as intent tags for the conversation, the method further includes: Obtaining complete text information of the conversation, wherein the length of the complete text information is greater than or equal to a fifth preset threshold; Inputting the complete text information into a long text multi-intent recognition model to obtain a long text intent label; The first intent label, the second intent label, and the long text intent label are used as intent labels for the conversation.

8. An intention recognition device, characterized in that: include: a determination module, configured to determine, based on a keyword table, whether a current sentence in a conversation contains a keyword in the keyword table, wherein the keyword table includes a plurality of tags and at least one keyword corresponding to each tag, and a tag recall rate of each keyword in the keyword table is greater than or equal to a first preset threshold; a first classification module, configured to, when the current sentence contains the keyword, determine a target label corresponding to the keyword, obtain context information containing the current sentence, input the context information into a first classification model, and obtain a first classification result, wherein the first classification result is used to determine whether the intent label corresponding to the current sentence is the target label, and if the intent label corresponding to the current sentence is the target label, use the target label as the first intent label; a second classification module, configured to sequentially locate local text information in the conversation according to a preset step size and a preset window size, and, if the first intent label includes a secondary label, determine the secondary label as a reference intent label, input the primary label to which the reference intent label belongs and the local text information into a second classification model to obtain a second classification result, wherein the second classification result includes a second intent label, and the primary label corresponding to the second intent label and the primary label corresponding to the first intent label have the same scene type, and the first classification model and the second classification model classify different intent labels into different types; The determination module is further configured to use the first intent tag and the second intent tag as intent tags for the conversation.

9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor, The processor is configured to execute the intention recognition method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program is used to execute the intention recognition method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Intention recognition method and device, processing equipment and medium

    CN112989003A

  • Method and system for identifying intention track of customer service hotline user

    CN114818738A