Intention recognition method and device, electronic equipment and storage medium

By segmenting customer sentences and calculating similarity, and combining contextual information to identify intent, the problem of accuracy and efficiency in intent recognition in customer service conversations is solved, achieving real-time and accurate multi-intent recognition.

CN116127010BActive Publication Date: 2026-06-05MASHANG CONSUMER FINANCE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MASHANG CONSUMER FINANCE CO LTD
Filing Date
2022-11-22
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

During customer service conversations, existing technologies struggle to accurately identify multiple intentions expressed by customers, especially in the case of long texts. Human memorization is prone to errors, and multi-intention classification models are costly and inefficient to train.

Method used

By segmenting customer sentences, retrieving a preset keyword list, calculating similarity values, determining candidate words, and when the similarity reaches a threshold, using contextual information for intent recognition, and combining BERT multi-classification model or other natural language processing models for intent label recognition.

Benefits of technology

It enables real-time multi-intent recognition during the session, improves the accuracy and efficiency of intent labeling, reduces the difficulty of recognition, and avoids omissions and misidentifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127010B_ABST
    Figure CN116127010B_ABST
Patent Text Reader

Abstract

The application provides an intention recognition method and device, electronic equipment and storage medium. The intention recognition method comprises: performing word segmentation processing on a target sentence in current session text from a customer to obtain at least one target word; determining whether there is a word with the same character as a plurality of keywords in a preset keyword table in the at least one target word, and if so, determining the word with the same character as a candidate word; calculating the similarity value between at least part of the keywords in the preset keyword table and the candidate word to obtain at least one similarity value; when there is a similarity value greater than or equal to a first preset threshold in the at least one similarity value, determining the context information of the target sentence; and performing intention recognition on the target sentence according to the context information to obtain a target intention label. The technical scheme of the application can realize the real-time of intention recognition, and improve the accuracy of the recognized intention label.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, specifically to an intent recognition method, apparatus, electronic device, and storage medium. Background Technology

[0002] During conversations between customer service representatives and customers, customers may express multiple intentions. In some cases, it is necessary to accurately identify and record these multiple intentions for downstream staff to process or for other subsequent tasks. Generally, multiple intentions expressed by customers during the conversation can be recorded manually, but this method is prone to errors and omissions. Alternatively, a multi-intention classification model can be used to classify the conversation content to obtain multiple intentions. However, this method places high demands on the model and has high training costs. Especially when the conversation is long, the model's classification performance is poor, making it difficult to accurately obtain multiple intentions. Summary of the Invention

[0003] In view of this, embodiments of this application provide an intent recognition method, apparatus, electronic device, and storage medium, which can achieve real-time intent recognition and improve the accuracy of the recognized intent tags.

[0004] In a first aspect, embodiments of this application provide an intent recognition method, comprising: segmenting a target sentence from a customer in the current conversation text to obtain at least one target word; determining whether there exists a word among the at least one target word that has the same character as multiple keywords in a preset keyword list, and if so, determining the word with the same character as a candidate word; calculating the similarity value between at least some keywords in the preset keyword list and the candidate word respectively to obtain at least one similarity value; when there is a similarity value greater than or equal to a first preset threshold among the at least one similarity value, determining the context information of the target sentence, the context information including multiple sentences that meet a preset quantity requirement; and performing intent recognition on the target sentence based on the context information to obtain a target intent tag corresponding to the target sentence.

[0005] Secondly, embodiments of this application provide an intent recognition device, comprising: a word segmentation module, used to segment a target sentence from a customer in the current conversation text to obtain at least one target word; a first determination module, used to determine whether there are words among the at least one target word that have the same characters as multiple keywords in a preset keyword list, and if so, to determine the words with the same characters as candidate words; a calculation module, used to calculate the similarity values ​​between at least some keywords in the preset keyword list and the candidate words respectively, to obtain at least one similarity value; a second determination module, used to determine the context information of the target sentence when there is a similarity value greater than or equal to a first preset threshold among the at least one similarity value, the context information including multiple sentences that meet a preset quantity requirement; and an identification module, used to perform intent recognition on the target sentence according to the context information to obtain a target intent tag corresponding to the target sentence.

[0006] Thirdly, embodiments of this application provide an electronic device, including: a processor; and a memory for storing processor-executable instructions, wherein the processor is used to execute the intent recognition method described in the first aspect above.

[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for performing the intent recognition method described in the first aspect.

[0008] Fifthly, embodiments of this application provide a computer program product including instructions that, when executed by a processor of a computer device, enable the computer device to perform the intent recognition method described in the first aspect.

[0009] This application provides an intent recognition method, apparatus, electronic device, and storage medium. It determines whether a target sentence contains words highly similar to keywords in a keyword list. When such words exist, the context information of the target sentence is determined, and intent tags are obtained by performing intent recognition based on the context information. Because this application can perform intent recognition on target sentences, it can continuously and in real-time recognize the intent expressed by customers during a conversation, achieving real-time intent recognition and enabling real-time multi-intent recognition of long texts from customer service hotlines. This application also determines whether the target words corresponding to the target sentence contain words with the same characters as keywords in a keyword list. When such words exist, they are identified as candidate words. This allows for the selection of candidate words from the target words, and the similarity between the candidate words and keywords is calculated, thus improving the efficiency of intent recognition. Furthermore, this embodiment calculates the similarity value between candidate words and at least some keywords. When a similarity value greater than or equal to a first preset threshold exists, intent recognition is performed on the target sentence. This improves the generalization of the intent recognition method and avoids cases where intent recognition is not performed on sentences containing customer intent, thus preventing missed intent tags. In addition, this embodiment determines the contextual information of the target sentence and performs intent recognition based on the contextual information, which shortens the text length for each intent recognition operation, reduces the recognition difficulty, and improves the accuracy of the final intent tags. Attached Figure Description

[0010] Figure 1 The diagram shown is a schematic representation of the system architecture of an intent recognition system provided in an exemplary embodiment of this application.

[0011] Figure 2 The diagram shown is a flowchart illustrating an intent recognition method provided in an exemplary embodiment of this application.

[0012] Figure 3 The diagram shown is a flowchart of an intent recognition method provided in another exemplary embodiment of this application.

[0013] Figure 4 The diagram shown is a schematic diagram of the structure of an intent recognition device provided in an exemplary embodiment of this application.

[0014] Figure 5 The diagram shown is a block diagram of an electronic device for performing an intent recognition method according to an exemplary embodiment of this application. Detailed Implementation

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

[0016] Related technologies

[0017] During customer communication, customers may express multiple intentions in a single conversation. For example, in a telemarketing scenario, a customer might express multiple intentions such as "purchase," "sign a contract," "renew," or "inquire about purchase terms." In a resource acquisition scenario, a customer might express multiple intentions such as "early repayment," "deferred repayment," "account cancellation," or "interest reduction." Customer service representatives need to record intent tags for the current work order based on the intentions expressed by the customer during the conversation for downstream staff to process. However, when the conversation is long and the customer expresses many intentions, recording intent tags for the current work order from memory is quite difficult for customer service representatives, requiring a high level of memory and business knowledge. Moreover, recording intent tags in this way is prone to errors and cannot capture all intentions, meaning the accuracy of intent tags is difficult to guarantee, and it is easy for intent tags to be missed.

[0018] Besides recording intent tags through customer service memory, a multi-intent classification model can be used to classify the entire conversation to obtain multiple intent tags. However, this method places high demands on the model. For example, in some cases, the text length of the entire conversation after speech-to-text conversion can reach more than 5,000 characters. If a large deep learning model is used as the classifier, the training cost is high, the inference performance is poor, and the order processing efficiency is low.

[0019] To address the aforementioned technical issues, this application embodiment segments the target sentence originating from the customer during a conversation to obtain at least one word. This word is then searched in a keyword list. When the similarity between a retrieved word and a keyword meets a preset threshold, the context information containing the target sentence is located based on that word, and the intent tag of the target sentence is identified based on the context information. This allows for real-time identification of the customer's intent based on local conversation content during the conversation, thereby improving the efficiency of multi-intent recognition for the entire conversation.

[0020] Exemplary System

[0021] Figure 1 The diagram shown is a schematic representation of the system architecture of an intent recognition system 100 provided in an exemplary embodiment of this application. Figure 1As shown, system 100 includes: user terminal device 110, outbound calling device 120, and intent recognition device 130.

[0022] Taking a telemarketing scenario as an example, the user terminal device 110 can be a mobile phone, tablet, personal computer, personal digital assistant, or other devices, enabling communication between the user / customer and customer service. Customer service can be a human or an intelligent customer service representative, and the outbound calling device 120 can include a server or a landline phone. For example, customer service can use the outbound calling device 120 to call a customer, establishing a communication connection with the user terminal device 110 via the network, allowing the customer and customer service to converse. The intent recognition device 130 can establish a communication connection with the outbound calling device 120 via the network to monitor the conversation between the customer and customer service in real time, and search for words from the customer's target sentence in the keyword list. When the similarity between a word in the target sentence and a keyword meets a preset threshold, the device locates the context information containing the target sentence based on that word, and then identifies the intent tag of the target sentence based on the context information. The intent recognition device 130 can provide real-time feedback of the identified intent tags to the customer service representative, allowing the representative to adjust communication strategies based on the current intent tag, or, if the reliability of the current intent tag is low, to facilitate the representative reconfirming the current intent with the customer through questioning or other means. At the end of the session, the intent recognition device 130 can obtain multiple intent tags corresponding to the entire session. Here, the intent recognition device 130 can be a computing device independent of the outbound calling device 120, or a computing device integrated into the outbound calling device 120.

[0023] In other scenarios, the outbound calling device 120 can also connect to the call of the user terminal device 110 to establish a communication connection with the user terminal device 110, enabling the customer and customer service representative to have a conversation. Optionally, the customer service representative and the customer can have a conversation via voice, and the intent recognition device 130 can convert the voice information into text information; alternatively, the customer service representative and the customer can also have a conversation via text.

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

[0025] Exemplary methods

[0026] Figure 2 The diagram shown is a flowchart illustrating an intent recognition method provided in an exemplary embodiment of this application. Figure 2 The method can be performed by a computing device (e.g., Figure 1 The intent recognition device 130 (or other electronic device) performs the execution. Figure 2 As shown, the intent recognition method includes the following:

[0027] 210: Perform word segmentation on the target sentence from the customer in the current conversation text to obtain at least one target word.

[0028] The current conversation text can be the communication text between the customer and customer service in real time. As the conversation progresses, the number of sentences in the current conversation text increases. At the end of this conversation, the complete conversation text can be obtained.

[0029] For example, a customer can have a conversation with customer service via text, and the text information in the conversation constitutes the current conversation text. Alternatively, a customer can have a conversation with customer service via voice, and the voice information in the conversation can be converted into text information to obtain the current conversation text.

[0030] The current conversation text includes sentences from the customer and sentences from customer service. The target sentence can be a sentence from the customer in the current conversation text. As the conversation progresses, sentences from the customer can be sequentially selected as target sentences, and subsequent intent recognition processes can be performed based on these target sentences. Alternatively, the target sentence can be determined from multiple sentences expressed by the customer in the conversation with a certain step size. For example, with a step size of 2, for each of the multiple sentences expressed by the customer, a target sentence can be determined for intent recognition after every other sentence.

[0031] Optionally, the target sentence can also be a sentence from the customer service representative in the current conversation text. As the conversation progresses, sentences from the customer service representative can be sequentially used as target sentences, and subsequent intent recognition processes can be performed based on these target sentences. Alternatively, the target sentence can be determined from among multiple sentences expressed by the customer service representative in the conversation with a certain step size.

[0032] Optionally, the target sentence can be any sentence in the current conversation text. As the conversation progresses, sentences in the current conversation text can be sequentially used as target sentences, and subsequent intent recognition processes can be performed based on the target sentences. Alternatively, the target sentence can be determined from multiple sentences in the conversation with a certain step size.

[0033] It should be understood that the rules for determining the target sentence in a conversation can be set according to the actual application needs, as long as it can ensure that the customer's multiple intentions in the whole conversation are identified.

[0034] Word segmentation can split a target sentence into one or more target words. The word segmentation method can be Jieba segmentation or other methods, and this application embodiment does not limit this.

[0035] 220: Determine whether there exists a word in at least one target word that has the same character as multiple keywords in the preset keyword list. If so, the word with the same character is determined as a candidate word.

[0036] The pre-defined keyword list can include keywords corresponding to multiple intent tags, with each intent tag potentially corresponding to one or more keywords. The pre-defined keyword list can be built from a large amount of historical conversation text, such as by tagging historical conversation text with intent tags and extracting corresponding keywords from the historical conversation text.

[0037] Candidate words can be selected from target words. Specifically, there may be one or more target words in the target sentence. For each target word, it can be determined whether there are keywords with the same characters as the target word in the preset keyword list. If so, the target word is determined as a candidate word.

[0038] For example, when constructing a pre-defined keyword table, an inverted index from characters to words (keywords) can be built based on the frequency statistics of the characters in the keywords. When performing intent recognition on the target sentence, for each target word, a search is performed in the keyword table using the inverted index from characters to words. If the search result is empty, it indicates that the character in the target word does not exist in the keyword table, and the probability of finding a semantically similar keyword is low; therefore, the target word can be eliminated. If the search result is not empty, it indicates that the character in the target word exists in the keyword table, and the probability of finding a semantically similar keyword is high; therefore, the target word can be considered a candidate word.

[0039] 230: Calculate the similarity values ​​between at least some of the keywords and candidate words in the preset keyword list, and obtain at least one similarity value.

[0040] Similarity scores characterize the degree of semantic similarity between candidate words and keywords. Specifically, similarity scores between candidate words and keywords can be calculated using cosine distance, Euclidean distance, or other methods.

[0041] The number of candidate words can be one or more. For each candidate word, the similarity value between at least some keywords and the candidate word can be calculated separately, thereby obtaining at least one similarity value for all candidate words.

[0042] In one example, for each candidate word, the similarity value between the candidate word and each keyword in the keyword list can be calculated separately to obtain multiple similarity values.

[0043] In another example, for each candidate word, at least one keyword with the same character as the candidate word can be identified in the keyword list, and the similarity value between the candidate word and the at least one keyword with the same character can be calculated to obtain at least one similarity value.

[0044] 240: When there is a similarity value greater than or equal to a first preset threshold in at least one similarity value, determine the context information of the target sentence. The context information includes multiple sentences that meet the preset quantity requirement.

[0045] Contextual information can be text information containing the target sentence. Specifically, contextual information can be selected from the current conversation text based on the position of the target sentence. The number of sentences contained in the contextual information meets the preset requirement, thus obtaining contextual information of appropriate length. This facilitates the identification of the target sentence's intent based on the content of the contextual information, reduces the difficulty of intent identification, and avoids the contextual information being too long or containing too much content, which could interfere with the intent identification process of the target sentence.

[0046] The trigger condition for determining the contextual information of the target sentence is that at least one similarity value exists that is greater than or equal to a first preset threshold.

[0047] For example, if there is only one candidate word, and there is a similarity value greater than or equal to the first preset threshold among the similarity values ​​corresponding to the candidate word, then the context information of the target sentence is determined.

[0048] For example, if there are multiple candidate words, and among the similarity values ​​corresponding to multiple candidate words, there is one with a similarity value greater than or equal to a first preset threshold, then the context information of the target sentence is determined. In other words, as long as there is a similarity value greater than or equal to the first preset threshold corresponding to any one candidate word, the context information of the target sentence is determined.

[0049] Specifically, if any similarity value among multiple candidate words is greater than or equal to a first preset threshold, it indicates that the target sentence is highly likely to contain intent, and user intent needs to be identified based on the target sentence. For example, to accurately identify a customer's intent, the contextual information of the target sentence can be combined to identify the intent contained in the target sentence. If no similarity value among multiple candidate words is greater than or equal to the first preset threshold, it indicates that the target sentence is unlikely to contain intent, meaning the target sentence may be casual conversation, and intent identification does not need to be performed based on the target sentence, thus improving the efficiency of intent identification.

[0050] This application's embodiments calculate the similarity value between candidate words and at least some keywords. When a similarity value greater than or equal to a first preset threshold exists, intent recognition is performed on the target sentence. This allows for the determination of words matching keywords based on semantic similarity, rather than relying on strong matching (where words must match keywords), i.e., it avoids relying on regular expression matching. This improves the generalization ability of the intent recognition method.

[0051] It should be understood that the first preset threshold and the preset quantity in the embodiments of this application can be set according to the needs of actual application scenarios.

[0052] 250: Based on the context information, perform intent recognition on the target sentence to obtain the target intent label corresponding to the target sentence.

[0053] In this embodiment, if the similarity value between a candidate word and a keyword is greater than or equal to a first preset threshold, it indicates that the customer intent contained in the target sentence may be similar to the intent represented by the intent tag corresponding to the keyword. Figure 1 However, in actual conversations, relying solely on a customer's single sentence may lead to a misunderstanding of their intent; that is, the customer's intent may require contextual information to be accurately understood. Therefore, this embodiment can locate the contextual information containing the target sentence based on the target sentence, and identify the intent of the target sentence based on the contextual information, which can improve the accuracy of intent recognition.

[0054] The intent recognition process can be achieved by using a natural language processing model to analyze contextual information, thereby identifying the intent of the target sentence and obtaining a target intent label.

[0055] Specifically, an intent classification model can be used to analyze contextual information, and the output of the intent classification model can include the corresponding target intent label. For example, the intent classification model can classify multiple intents, and each classification can output an intent label. Different contextual information input into the intent classification model can yield different intent labels. The intent classification model in this embodiment can be a BERT multi-classification model or other natural language processing models.

[0056] Optionally, analyzing the contextual information using an intent classification model can yield scores for multiple intents, which are the intents that the intent classification model can recognize. The target intent label can be determined based on the scores of these multiple intents. For example, if the intent classification model can recognize three types of intent labels, classifying the contextual information using the intent classification model can output scores for the three intent labels. The computing device can then use the intent label corresponding to the highest score as the output target intent label. Alternatively, the intent classification model can output the intent label corresponding to the highest score as the target intent label; that is, the intent classification model can output scores for multiple intent labels and the identified target intent label.

[0057] By analyzing the sentences expressed by customers in real time during a conversation, multiple intent tags can be obtained at the end of the conversation. These intent tags can be passed to downstream services as the labeling results for the entire conversation. Downstream services may include quality inspection and sample construction. Quality inspection may specifically evaluate the customer service representative's performance throughout the conversation based on the labeling results. Sample construction may extract local information from the conversation based on the labeling results to obtain samples, which can be used to train a model that can recognize certain intent tags.

[0058] This application provides an intent recognition method. It determines whether a target sentence contains words highly similar to keywords in a keyword list. When such words exist, the context information of the target sentence is determined, and intent tags are obtained based on this context information. Since this application can perform intent recognition on target sentences, it can continuously and in real-time identify the intent expressed by customers during a conversation, achieving real-time intent recognition and enabling real-time multi-intent recognition of long texts from customer service hotlines. This application also determines whether the target words corresponding to the target sentence contain words with the same characters as keywords in a keyword list. When such words exist, they are identified as candidate words. This allows for the selection of candidate words from the target words, and the similarity between the candidate words and keywords is calculated, thus improving the efficiency of intent recognition. Furthermore, this embodiment calculates the similarity value between candidate words and at least some keywords. When a similarity value greater than or equal to a first preset threshold exists, intent recognition is performed on the target sentence. This improves the generalization of the intent recognition method and avoids cases where intent recognition is not performed on sentences containing customer intent, thus preventing missed intent tags. In addition, this embodiment determines the contextual information of the target sentence and performs intent recognition based on the contextual information, which shortens the text length for each intent recognition operation, reduces the recognition difficulty, and improves the accuracy of the final intent tags.

[0059] According to one embodiment of this application, a preset keyword list includes multiple clusters, each cluster including at least one first representation vector corresponding to at least one keyword; calculating the similarity value between at least some keywords and candidate words in the preset keyword list to obtain at least one similarity value includes: determining the second representation vector corresponding to the candidate word; calculating the distance between the center representation vector and the second representation vector of each cluster in the multiple clusters to obtain multiple distance values, wherein the center representation vector is the weighted sum of at least one first representation vector in the cluster; determining the cluster corresponding to the minimum distance value among the multiple distance values ​​as the target cluster, and determining at least one keyword in the target cluster as at least some keywords; calculating the similarity value between the first representation vector and the second representation vector corresponding to at least some keywords to obtain at least one similarity value.

[0060] Specifically, keywords in the keyword list can be represented by vectors. For example, the first representation vector corresponding to each keyword can be determined by a model, such as the Simcse unsupervised contrastive learning model (also known as a synonym mining model) or other natural language processing models. Multiple first representation vectors corresponding to multiple keywords can be clustered. If the number of intent labels corresponding to the keyword list is K, clustering can be performed using K points in the space as centers, dividing the first representation vector space into K clusters, with each cluster corresponding to a central representation vector.

[0061] The center representation vector is a weighted sum of at least one first representation vector in the corresponding cluster. For example, the center representation vector may be the average of at least one first representation vector in the corresponding cluster.

[0062] The keyword list can include multiple clusters, and each cluster can include one or more first representation vectors corresponding to keywords. Keywords corresponding to multiple first representation vectors in the same cluster can be semantically similar.

[0063] When determining the similarity value between candidate words and keywords, we can first determine the second representation vector corresponding to the candidate words, and then calculate the distance value between the second representation vector and the center representation vector corresponding to each cluster, obtaining multiple distance values. These distance values ​​can be obtained based on cosine distance, Euclidean distance, or other methods. Furthermore, the cluster corresponding to the smallest distance value among these multiple distance values ​​can be taken as the nearest neighbor cluster, i.e., the target cluster. The similarity value between the second representation vector and the first representation vector under the target cluster is then calculated. Since the target cluster may include at least one first representation vector, at least one similarity value can be obtained.

[0064] Similar to the process of obtaining the first representation vector, the candidate words can be vectorized using the Simcse unsupervised contrastive learning model to obtain the second representation vector.

[0065] For example, in a scenario where the target sentence is "Your staff's tone is very bad," word segmentation of the target sentence yields multiple target words, such as "your / staff / of / tone / is very bad." Candidate words identified from these multiple target words can be "staff" and "tone." Further, multiple candidate words can be traversed in the keyword list. When the word "tone" is encountered, it is vectorized using the Simcse unsupervised contrastive learning model and denoted as a second representation vector L. The distance values ​​between the second representation vector L and the center representation vectors of K clusters are sorted, and the cluster corresponding to the smallest distance value is determined as the target cluster. The similarity values ​​between the second representation vector and multiple first representation vectors under the target cluster are calculated. When the maximum similarity value is greater than or equal to a first preset threshold, intent recognition is performed on the target sentence. The keyword corresponding to the maximum similarity value can be "tone," meaning "tone" can be recalled as a synonym for "tone." For the candidate word "staff," the maximum similarity value may be less than the first preset threshold when calculating the similarity score. However, since the maximum similarity value for "tone" is greater than or equal to the first preset threshold, intent recognition can be performed on the target sentence.

[0066] For example, the contextual information obtained by concatenating the two sentences before the target sentence, the target sentence itself, and the two sentences after the target sentence is "I want to report a problem #What do you want to ask? #The staff member's tone was particularly bad #I'm very sorry for the bad experience #I want to report this situation." Because the contextual information incorporates more semantic information from the scene, and integrates the sentences expressed by the customer and the customer service representative, the reliability of subsequent intent recognition results can be improved.

[0067] In this embodiment, the process of selecting candidate words from multiple target words can be considered a coarse ranking process; the process of determining the similarity value between each candidate word and the first representation vector in the target cluster, and determining whether there is a similarity value greater than or equal to a first preset threshold among the multiple similarity values ​​corresponding to multiple candidate words, can be considered a fine ranking process. By combining coarse and fine ranking, the intent recognition process can be shortened and the efficiency of intent recognition can be improved.

[0068] According to one embodiment of this application, determining the context information of a target sentence includes: concatenating the previous M sentences, the target sentence, and the next N sentences of the target sentence in the current conversation text to obtain context information, wherein M and N are integers greater than or equal to 1, and the sum of M and N is a second preset threshold.

[0069] The second preset threshold can be set according to the needs of the actual application scenario. M and N can be equal or unequal. For example, if the second preset threshold is 4, M equals N, and M equals 2, then the number of sentences contained in the context information is 5.

[0070] When M and N are equal, by placing the target sentence in the middle of the context information, we can fully consider the preceding and following information related to the target sentence, avoid missing key information for intent recognition, and thus improve the accuracy of intent recognition.

[0071] According to one embodiment of this application, intent recognition of a target sentence based on contextual information to obtain a target intent label corresponding to the target sentence includes: encoding multiple sentences in the contextual information using an encoding network in an intent classification model to obtain multiple sentence vectors; determining weight values ​​corresponding to the multiple sentence vectors according to preset rules to obtain multiple weight values, wherein the preset rules include the weight value of the sentence vector corresponding to the target sentence being the maximum value among the multiple weight values; performing a weighted summation of the multiple sentence vectors based on the multiple weight values ​​to obtain a first text representation vector of the contextual information; classifying the first text representation vector using a classification network in the intent classification model to obtain multiple scores corresponding to multiple intent labels, wherein the multiple intent labels are fixed labels that the classification network can recognize; and determining the target intent label corresponding to the target sentence based on the multiple scores corresponding to the multiple intent labels.

[0072] Specifically, the intent classification model may include an encoding network and a classification network. After inputting contextual information into the classification model, the encoding network can encode multiple sentences in the contextual information separately, obtaining multiple sentence vectors. Further, weight values ​​corresponding to each of the multiple sentence vectors can be determined according to preset rules, resulting in multiple weight values. The preset rules can be pre-set according to actual needs, and include the fact that the weight value of the sentence vector corresponding to the target sentence is the maximum value among the multiple weight values. For example, the preset rule could be that the weight value of the sentence vector corresponding to the target sentence is 60%, and the weight values ​​of the remaining sentence vectors are the ratios of 40% to the number of remaining sentence vectors.

[0073] In one example, an encoding network can be used to determine multiple weight values ​​corresponding to multiple sentence vectors, and the multiple sentence vectors can be weighted and summed according to the multiple weight values ​​to obtain the first text representation vector of the context information.

[0074] In another example, the intent classification model may also include other networks that can be used to determine multiple weight values ​​corresponding to multiple sentence vectors, and then perform a weighted summation of the multiple sentence vectors to obtain a first text representation vector of the context information.

[0075] Classification networks can classify multiple intents, and each classification outputs an intent label. By classifying a first text representation vector using a classification network, multiple scores corresponding to multiple intent labels can be obtained, with each intent label corresponding to one score. The classification network can output the intent label corresponding to the highest score among multiple scores as the recognition result, or it can choose not to output the score for each intent label. The intent label output by the intent classification model can be determined as the target intent label.

[0076] In this embodiment, the target intent label is obtained by processing the contextual information using an intent classification model, which can improve the efficiency and accuracy of intent recognition. By determining the weight values ​​corresponding to multiple sentence vectors according to preset rules, multiple weight values ​​are obtained. Then, the multiple sentence vectors are weighted and summed according to the multiple weight values ​​to obtain the first text representation vector of the contextual information. This can increase the contribution of the target sentence to the first text representation vector, thereby further improving the accuracy of intent recognition.

[0077] According to one embodiment of this application, determining the target intent label corresponding to the target sentence based on multiple scores corresponding to multiple intent labels includes: using a classification network to determine the intent label corresponding to the highest score among the multiple scores as the first intent label to be confirmed; determining the entropy value corresponding to the first intent label to be confirmed based on the multiple scores corresponding to the multiple intent labels and a preset formula, wherein a higher entropy value indicates a lower reliability of the first intent label to be confirmed, and the preset formula is as follows: n is the number of intent tags, P i The score is assigned to the i-th intent label among multiple intent labels; when the entropy value is greater than or equal to the third preset threshold, the first intent label to be confirmed is determined as the second intent label to be confirmed; based on the customer's response information to the sentence corresponding to the second intent label to be confirmed in the current conversation text, it is determined whether the second intent label to be confirmed is the target intent label; when the entropy value is less than the third preset threshold, the first intent label to be confirmed is determined as the target intent label.

[0078] Each time the intent classification model processes the context information, it can output scores corresponding to multiple intent labels and an intent label determined based on the scores of these multiple intent labels. The intent label output by the intent classification model is the first intent label to be confirmed.

[0079] For example, the intent classification model can identify three intent labels. The scores corresponding to the three intent labels output by the intent classification model are (0.2, 0.2, 0.6), and the intent labels corresponding to 0.2, 0.2, and 0.6 are intent label 1, intent label 2, and intent label 3, respectively. Since intent label 3 has the highest score, the intent classification model outputs intent label 3 based on the scores of the three intent labels. Because the score corresponding to intent label 3 differs significantly from the scores corresponding to the other two intent labels, the reliability of the intent label output by the intent classification model is high.

[0080] For example, the intent classification model outputs three intent labels with scores of (0.3, 0.3, 0.2). Based on these scores, the intent classification model outputs intent label 2. Since the scores for the three intent labels are not significantly different, the intent label output by the intent classification model may be incorrect.

[0081] Specifically, the reliability of the first intent label to be confirmed output by the intent classification model can be evaluated based on the score corresponding to each intent label. For example, the entropy value of the first intent label to be confirmed can be calculated using the score corresponding to each intent label. The higher the entropy value, the smaller the difference between the scores corresponding to multiple intent labels, which indicates that the reliability of the first intent label to be confirmed is lower. The entropy value of the first intent label to be confirmed can be calculated using the above-mentioned preset formula. Of course, other entropy value calculation formulas can also be set according to actual needs, and this application embodiment does not limit this.

[0082] In this embodiment, a third preset threshold can be set according to actual needs. When the entropy value is less than the third preset threshold, the first intent label to be confirmed can be determined as the target intent label. When the entropy value is greater than or equal to the third preset threshold, the first intent label to be confirmed is determined as the second intent label to be confirmed. The computing device can present the second intent label to the customer service representative. The sentence corresponding to the second intent label to be confirmed can be a question or a statement, which is a sentence used by the customer service representative to further confirm with the customer whether the intent corresponding to the intent label is the customer's true intent. For example, the customer service representative can ask the customer a question based on the intent corresponding to the second intent label to be confirmed, and the computing device can determine whether the second intent label to be confirmed is the target intent label based on the customer's response information. If the customer's answer is affirmative, then the second intent label to be confirmed is the target intent label; if the customer's answer is negative, then the second intent label to be confirmed is not the target intent label and can be discarded.

[0083] In real-world applications, customer statements may be indirect or unclear, or the intent classification model itself may have limited accuracy. These issues can lead to inaccurate intent labels output by the model. In this embodiment, the entropy value of the intent label output by the model is calculated to determine whether the label is a pending confirmation. Specifically, the entropy value of the intent label determines whether further confirmation of its reliability with the customer is needed, thus improving the accuracy and reliability of the target intent label.

[0084] According to one embodiment of this application, determining whether a second intent tag to be confirmed is a target intent tag based on the customer's response information to the sentence corresponding to the second intent tag to be confirmed in the current conversation text includes: encoding the response information using an encoding network in an emotion recognition model to obtain a second text representation vector corresponding to the response information; classifying the second text representation vector using a classification network in an emotion recognition model to obtain a classification result, the classification result being used to characterize whether the emotion of the response information is positive or negative; and determining the second intent tag to be confirmed as the target intent tag when the classification result is positive.

[0085] Emotion recognition models can be used to identify whether the emotions expressed by customers in their responses are positive or negative. For example, positive emotions can indicate that the response is affirmative, while negative emotions can indicate that the response is negative.

[0086] Specifically, an emotion recognition model may include an encoding network and a classification network. After inputting response information into the emotion recognition model, the encoding network can encode the response information to obtain a second text representation vector. Further, the classification network can classify the second text representation vector to obtain a classification result.

[0087] In one example, the training samples for the sentiment recognition model can be general expressions of positive sentiment / “affirmation” (positive sentiment data samples) and general expressions of negative sentiment / “negation” (negative sentiment data samples). For example, a positive sentiment data sample like “Yes, that’s what I meant” can be classified as a positive example; a negative sentiment data sample like “No, that’s not what I meant” can be classified as a negative example. By constructing datasets of positive and negative examples and training the model, the sentiment recognition model can be obtained.

[0088] The entropy value of the intent label can serve as the basis for customer service representatives to ask questions of customers. Specifically, an entropy value greater than or equal to a third preset threshold can be considered a condition for customer service representatives to ask questions, and also a trigger or switch for sentiment recognition. For example, customer responses to customer service questions can be input into the sentiment recognition model. The model can output "positive sentiment" / "affirmation," or "negative sentiment" / "negation." If the sentiment recognition model outputs "positive sentiment," the intent label to be confirmed is the target intent label; if the model outputs "negative sentiment," the intent label to be confirmed is not the target intent label.

[0089] For example, in one scenario, the intent classification model outputs the intent label "cancel account," but the entropy value corresponding to this intent label is higher than 1. This indicates that the reliability of the intent label is low, and customer service needs to further confirm the accuracy of the intent label with the customer. Customer service could ask the customer, "Are you sure you want to cancel your account?" Then, an emotion recognition model can be used to assess the customer's response and output either "positive emotion" or "negative emotion." If the emotion recognition model outputs "positive emotion," it indicates that "cancel account" is the target intent label; if the emotion recognition model outputs "negative emotion," it indicates that "cancel account" is not the target intent label and can be discarded.

[0090] Since there are many ways to express "positive emotions" or "negative emotions," in this embodiment, identifying whether the emotions in the customer's response information are positive or negative through an emotion recognition model can improve the accuracy of customer emotion recognition and thus improve the reliability of the obtained target intent labels.

[0091] According to one embodiment of this application, the intent recognition method further includes: sequentially determining multiple sentences expressed by the customer after the target sentence as the target sentence; repeatedly executing the step of determining the entropy value corresponding to the first intent tag to be confirmed based on multiple scores corresponding to multiple intent tags and a preset formula to obtain multiple target intent tags corresponding to the current conversation text; sorting the multiple target intent tags in ascending order of the entropy values ​​corresponding to the multiple target intent tags to obtain a sorting result; and selecting the top K target intent tags from the sorting result as intent tags of the conversation text according to a preset number K.

[0092] Specifically, as the conversation progresses, sentences expressed by the customer are sequentially identified as target sentences. These target sentences are then segmented to obtain at least one target word. Candidate words are selected from these target words, and the similarity values ​​between the candidate words and at least some keywords in the keyword list are calculated to obtain at least one similarity value. If any of the at least one similarity value is greater than or equal to a first preset threshold, the contextual information of the target sentence is determined, and intent recognition is performed on the target sentence based on this contextual information. When the entropy value corresponding to the intent label output by the intent classification model is less than a third preset threshold, or when the entropy value is greater than or equal to the third preset threshold and the sentiment recognition model outputs a positive sentiment, the target intent label for the target sentence is obtained. As the conversation continues, the target sentences are continuously updated. At the end of the conversation between the customer service representative and the customer, multiple target intent labels expressed by the customer throughout the entire conversation text can be obtained.

[0093] Optionally, after analyzing the contextual information of the target sentence, the sentence originating from the customer following the contextual information can be identified as the target sentence; if the contextual information of the target sentence cannot be located, the sentence originating from the customer following the target sentence can be identified as the target sentence. This ensures that sentences originating from the customer throughout the entire conversation are considered, avoiding omission of the customer's intent, and also improving the efficiency of intent recognition.

[0094] Furthermore, K target intent tags can be selected from multiple target intent tags corresponding to the entire conversation text as the intent tags of the conversation text. The preset number K can be the number of intent tags to be output in the final output based on actual needs. For example, if the number of current target intent tags is greater than the preset number K, the first K target intent tags can be selected from multiple target intent tags as the final intent tags based on the entropy value in ascending order.

[0095] In this embodiment, by continuously updating the target sentence, the customer's intent can be identified in real time during the conversation, thus providing a basis for adjusting customer service communication strategies and avoiding the omission of customer intent. Furthermore, since intent identification is performed on local information within the conversation each time, the training cost of the model can be reduced, and the accuracy and reliability of the target intent label can be improved. In addition, this embodiment can output the target intent label with the smaller entropy value as the final intent label, thus further improving the reliability of the final intent label.

[0096] According to one embodiment of this application, the intent recognition method further includes: acquiring multiple historical conversation samples corresponding to multiple intent tags respectively; calculating the word frequency of each word in the multiple historical conversation samples corresponding to each intent tag; determining words with word frequencies greater than or equal to a fourth preset threshold as keywords corresponding to the intent tag; and constructing a preset keyword table based on the keywords.

[0097] Specifically, the historical conversation samples can be texts labeled with intent tags, and each intent tag can correspond to multiple historical conversation samples. For each intent tag, the word frequencies of each word in multiple historical conversation samples can be counted. For each word, the word frequency can represent the number of historical conversation samples in which the word appears in multiple historical conversation samples. When the word frequency is greater than or equal to the fourth preset threshold, it indicates that the word has a high recall rate for the intent tag and can be added to the keyword list. The fourth preset threshold in this embodiment can be set according to actual needs.

[0098] For example, when constructing the keywords corresponding to intent tag A, the historical conversation samples corresponding to intent tag A can be collected first, and the total number of historical conversation samples corresponding to intent tag A is N; a keyword corresponding to intent tag A is keyword B, and keyword B appears in M historical conversation samples among the N historical conversation samples. Therefore, the tag recall rate of keyword B is N / M. When the tag recall rate corresponding to a keyword is higher, it indicates that the possibility that the intent expressed by the conversation content containing the keyword is consistent with the intent represented by the intent tag corresponding to the keyword is greater, that is, the reliability of the recall of the keyword for the corresponding intent tag is higher. Therefore, keywords with a tag recall rate higher than a certain threshold can be added to the keyword list.

[0099] Taking the telemarketing scenario as an example, the historical conversation samples corresponding to the intent tags "poor attitude of staff", "canceling the account", and "stopping making calls" can be collected respectively. For the intent tag "poor attitude of staff", the keywords included in the corresponding historical conversation samples are "attitude", "tone", etc. These keywords have a high recall rate under the conversation data corresponding to the intent tag "poor attitude of staff", so these keywords can be added to the keyword list. Similarly, according to this principle, the keywords of all intent tags can be constructed, and finally a keyword list is obtained.

[0100] Furthermore, an inverted index from characters to words can be established for the keyword list, that is, the keywords in the keyword list are divided in the way from characters to words. For example, for the character "气", the keywords in the keyword list that contain the character "气" are "语气" and "口气", so that the corresponding relationship between "气" and "语气" as well as "口气" can be established. Through the inverted index method, multiple words in the target sentence can be screened to obtain candidate words.

[0101] In this embodiment, determining the words with a word frequency greater than or equal to the fourth preset threshold as the keywords corresponding to the intent tag and constructing a preset keyword list based on the keyword can improve the quality of the keyword list and the accuracy of intent recognition.

[0102] Figure 3The diagram shown is a flowchart of an intent recognition method provided in another exemplary embodiment of this application. Figure 3 The example is Figure 2 Examples of the embodiments are provided below; to avoid repetition, the similarities can be referred to the descriptions in the above embodiments, and will not be repeated here. For example... Figure 3 As shown, the intent recognition method includes the following:

[0103] 310: Perform word segmentation on the target sentence in the current conversation text to obtain at least one word.

[0104] The target sentence can be a sentence derived from the client.

[0105] 320: Determine whether a candidate word exists in at least one word.

[0106] Specifically, based on the keyword table, an inverted index from character to word can be used to determine whether at least one word contains words that share the same characters as multiple keywords in the keyword table. If so, then at least one word is identified as a candidate word, and words with the same characters are identified as candidate words, and step 330 is executed; otherwise, step 393 is executed.

[0107] 330: Determine the second representation vector corresponding to the candidate words, calculate the distance between the second representation vector and the center representation vector of multiple clusters in the keyword table, obtain multiple distance values, determine the cluster corresponding to the smallest distance value among the multiple distance values ​​as the target cluster, and calculate the similarity value between at least one first representation vector in the target cluster and the second representation vector, obtain at least one similarity value.

[0108] The keyword table may include multiple clusters, and each cluster may include at least one first representation vector corresponding to a keyword.

[0109] 340: Determine whether there exists a similarity value greater than or equal to a first preset threshold among at least one similarity value.

[0110] For example, it can be determined whether the maximum similarity value among at least one similarity value is greater than or equal to a first preset threshold. If yes, step 350 can be executed; otherwise, step 393 can be executed.

[0111] 350: Determine the context information of the target sentence, and perform intent recognition on the target sentence based on the context information to obtain the intent label and the entropy value corresponding to the intent label.

[0112] The context information meets the preset length requirement. For example, the context information can be obtained by concatenating the M sentences preceding the target sentence, the target sentence, and the N sentences following the target sentence.

[0113] The process for determining the entropy value corresponding to the intent label can be referred to the description in the above embodiments.

[0114] 360: Determine whether the entropy value is greater than or equal to the third preset threshold.

[0115] If the entropy value is greater than or equal to the third preset threshold, step 370 can be executed; otherwise, step 392 can be executed.

[0116] 370: Determine the intent label as the intent label to be confirmed, and input the customer's response information to the sentence corresponding to the intent label to be confirmed in the current conversation text into the sentiment recognition model.

[0117] 380: Determine whether the output of the emotion recognition model is a positive emotion.

[0118] If the output of the emotion recognition model is positive emotion, then step 390 can be executed; otherwise, step 391 can be executed.

[0119] 390: The intent tag to be confirmed is the target intent tag.

[0120] 391: Update the first sentence expressed by the customer after the context information to the target sentence.

[0121] 392: Determine the intent label as the target intent label.

[0122] 393: Update the first sentence expressed by the customer after the target sentence to the target sentence.

[0123] Specifically, the first sentence expressed by the customer after the target sentence is updated to the target sentence, and step 310 is repeated to begin a new round of intent recognition. When the target sentence is the last sentence expressed by the customer in the conversation text, the intent recognition process can end, and multiple target intent tags are output. Further, a preset number of target intent tags are determined as the final intent tags based on the entropy values ​​corresponding to the multiple target intent tags. Optionally, in a telemarketing scenario, the multiple output target intent tags can be verified by a human customer service representative to determine whether to apply these tags to the final work order. For example, the human customer service representative can adjust the target intent tags according to the actual situation.

[0124] Exemplary device

[0125] Figure 4 The diagram shown is a structural schematic of an intent recognition device 400 provided in an exemplary embodiment of this application. Figure 4 As shown, the intent recognition device 400 includes: a word segmentation module 410, a first determination module 420, a calculation module 430, a second determination module 440, and a recognition module 450.

[0126] The word segmentation module 410 is used to segment the target sentence from the customer in the current conversation text to obtain at least one target word; the first determination module 420 is used to determine whether there are words with the same characters as multiple keywords in a preset keyword list among the at least one target word, and if so, the words with the same characters are determined as candidate words; the calculation module 430 is used to calculate the similarity value between at least some keywords in the preset keyword list and the candidate words respectively to obtain at least one similarity value; the second determination module 440 is used to determine the context information of the target sentence when there is a similarity value greater than or equal to a first preset threshold among the at least one similarity value, and the context information includes multiple sentences that meet the preset quantity requirements; the recognition module 450 is used to perform intent recognition on the target sentence according to the context information to obtain the target intent tag corresponding to the target sentence.

[0127] This application provides an intent recognition device. It determines whether a target sentence contains words highly similar to keywords in a keyword list. When such words exist, the device determines the context information of the target sentence and then performs intent recognition based on this context information to obtain an intent tag. Because this application can perform intent recognition on target sentences, it can continuously and in real-time recognize the intent expressed by customers during a conversation, achieving real-time intent recognition and enabling real-time multi-intent recognition of long texts from customer service hotlines. This application also determines whether the target words corresponding to the target sentence contain words with the same characters as keywords in a keyword list. When such words exist, they are identified as candidate words. This allows for the selection of candidate words from the target words, and the similarity between the candidate words and keywords is calculated, thus improving the efficiency of intent recognition. Furthermore, this embodiment calculates the similarity value between candidate words and at least some keywords. When a similarity value greater than or equal to a first preset threshold exists, intent recognition is performed on the target sentence. This improves the generalization of the intent recognition method and avoids cases where intent recognition is not performed on sentences containing customer intent, thus preventing missed intent tags. In addition, this embodiment determines the contextual information of the target sentence and performs intent recognition based on the contextual information, which shortens the text length for each intent recognition operation, reduces the recognition difficulty, and improves the accuracy of the final intent tags.

[0128] According to an embodiment of this application, a preset keyword list includes multiple clusters, each cluster including at least one first representation vector corresponding to at least one keyword; the calculation module 430 is used to: determine the second representation vector corresponding to the candidate words; calculate the distance between the center representation vector and the second representation vector of each cluster in the multiple clusters to obtain multiple distance values, wherein the center representation vector is the weighted sum of at least one first representation vector in the cluster; determine the cluster corresponding to the minimum distance value among the multiple distance values ​​as the target cluster, and determine at least one keyword in the target cluster as at least some keywords; calculate the similarity value between the first representation vector and the second representation vector corresponding to the at least some keywords to obtain at least one similarity value.

[0129] According to an embodiment of this application, the second determining module 440 is used to: concatenate the previous M sentences, the target sentence, and the next N sentences of the target sentence in the current conversation text to obtain context information, wherein M and N are integers greater than or equal to 1, and the sum of M and N is a second preset threshold.

[0130] According to one embodiment of this application, the recognition module 450 is configured to: encode multiple sentences in the context information using an encoding network in an intent classification model to obtain multiple sentence vectors; determine the weight values ​​corresponding to the multiple sentence vectors according to preset rules to obtain multiple weight values, wherein the preset rules include the weight value of the sentence vector corresponding to the target sentence being the maximum value among the multiple weight values; perform a weighted summation of the multiple sentence vectors based on the multiple weight values ​​to obtain a first text representation vector of the context information; classify the first text representation vector using a classification network in the intent classification model to obtain multiple scores corresponding to multiple intent labels, wherein the multiple intent labels are fixed labels that the classification network can recognize; and determine the target intent label corresponding to the target sentence based on the multiple scores corresponding to the multiple intent labels.

[0131] According to one embodiment of this application, the identification module 450 is configured to: use a classification network to determine the intent label corresponding to the highest score among multiple scores as the first intent label to be confirmed; determine the entropy value corresponding to the first intent label to be confirmed based on the multiple scores corresponding to the multiple intent labels and a preset formula, wherein a higher entropy value indicates a lower reliability of the first intent label to be confirmed, and the preset formula is: n is the number of intent labels, P i The score is assigned to the i-th intent label among multiple intent labels; when the entropy value is greater than or equal to the third preset threshold, the first intent label to be confirmed is determined as the second intent label to be confirmed; based on the customer's response information to the sentence corresponding to the second intent label to be confirmed in the current conversation text, it is determined whether the second intent label to be confirmed is the target intent label; when the entropy value is less than the third preset threshold, the first intent label to be confirmed is determined as the target intent label.

[0132] According to one embodiment of this application, the identification module 450 is used to: encode the response information using the encoding network in the emotion recognition model to obtain a second text representation vector corresponding to the response information; classify the second text representation vector using the classification network in the emotion recognition model to obtain a classification result, the classification result being used to characterize whether the emotion of the response information is positive or negative; when the classification result is positive, determine the second intent label to be confirmed as the target intent label.

[0133] According to one embodiment of this application, the second determining module 440 is further configured to: sequentially determine multiple sentences expressed by the customer after the target sentence as the target sentence; repeatedly execute the step of determining the entropy value corresponding to the first intent tag to be confirmed based on multiple scores corresponding to multiple intent tags and a preset formula, thereby obtaining multiple target intent tags corresponding to the current conversation text; sort the multiple target intent tags in ascending order of the entropy values ​​corresponding to the multiple target intent tags to obtain a sorting result; and select the top K target intent tags from the sorting result as intent tags of the conversation text according to a preset number K.

[0134] According to one embodiment of this application, the intent recognition device 400 further includes an acquisition module, configured to: acquire multiple historical conversation samples corresponding to multiple intent tags respectively; count the word frequency of each word in the multiple historical conversation samples corresponding to each intent tag; determine words with word frequencies greater than or equal to a fourth preset threshold as keywords corresponding to the intent tag; and construct a preset keyword table based on the keywords.

[0135] It should be understood that the operation and function of the word segmentation module 410, the first determination module 420, the calculation module 430, the second determination module 440, the recognition module 450, and the acquisition module in the above embodiments can be referred to the above. Figure 2 or Figure 3 The description of the intent recognition method provided in the embodiments will not be repeated here to avoid repetition.

[0136] Figure 5 The diagram shown is a block diagram of an electronic device 500 for performing an intent recognition method according to an exemplary embodiment of this application.

[0137] Reference Figure 5 The electronic device 500 includes a processor 510 and memory resources represented by a memory 520 for storing instructions executable by the processor 510, such as application programs. The application programs stored in the memory 520 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processor 510 is configured to execute instructions to perform the aforementioned intent recognition method.

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

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

[0140] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0141] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0142] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0143] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0144] The units described as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0145] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0146] If the aforementioned functions are implemented as 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 this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program verification codes, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0147] 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 construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0148] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications or equivalent substitutions made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An intent recognition method, characterized in that, include: The target sentence from the customer in the current conversation text is segmented to obtain at least one target word; Determine whether there are words among the at least one target word that have the same characters as multiple keywords in a preset keyword list. If so, then the words with the same characters are determined as candidate words. Calculate the similarity value between at least one keyword contained in the target cluster of the preset keyword table and the candidate word to obtain at least one similarity value; wherein, the preset keyword table includes multiple clusters; the target cluster is the cluster with the smallest distance between the center representation vector and the representation vector of the candidate word among the multiple clusters; When there is a similarity value greater than or equal to a first preset threshold among the at least one similarity value, the context information of the target sentence is determined, and the context information includes multiple sentences that meet a preset quantity requirement; The intent of the target sentence is identified based on the context information to obtain the target intent label corresponding to the target sentence.

2. The intent recognition method according to claim 1, characterized in that, Each cluster includes at least one first representation vector corresponding to at least one keyword; the step of calculating the similarity value between at least some keywords in the preset keyword table and the candidate words to obtain at least one similarity value includes: determining the second representation vector corresponding to the candidate words; Calculate the distance between the center representation vector of each cluster and the second representation vector in the plurality of clusters to obtain multiple distance values, wherein the center representation vector is a weighted sum of at least one first representation vector in the cluster; The cluster corresponding to the minimum distance value among the plurality of distance values ​​is determined as the target cluster, and at least one keyword in the target cluster is determined as the at least partial keyword; The similarity values ​​between the first representation vector and the second representation vector corresponding to at least some of the keywords are calculated respectively to obtain the at least one similarity value.

3. The intent recognition method according to claim 1, characterized in that, Determining the context information of the target sentence includes: The context information is obtained by concatenating the M sentences preceding the target sentence in the current conversation text, the target sentence, and the N sentences following the target sentence in the current conversation text, wherein M and N are integers greater than or equal to 1, and the sum of M and N is a second preset threshold.

4. The intent recognition method according to any one of claims 1 to 3, characterized in that, The step of performing intent recognition on the target sentence based on the context information to obtain the target intent tag corresponding to the target sentence includes: The encoding network in the intent classification model is used to encode multiple sentences in the context information to obtain multiple sentence vectors; According to a preset rule, the weight values ​​corresponding to the multiple sentence vectors are determined respectively, resulting in multiple weight values. The preset rule includes that the weight value of the sentence vector corresponding to the target sentence is the maximum value among the multiple weight values. The multiple sentence vectors are weighted and summed according to the multiple weight values ​​to obtain the first text representation vector of the context information; The first text representation vector is classified using the classification network in the intent classification model to obtain multiple scores corresponding to multiple intent labels, wherein the multiple intent labels are fixed labels that the classification network can recognize; The target intent label corresponding to the target sentence is determined based on the multiple scores corresponding to the multiple intent labels.

5. The intent recognition method according to claim 4, characterized in that, The step of determining the target intent label corresponding to the target sentence based on the multiple scores corresponding to the multiple intent labels includes: The intent label corresponding to the highest score among the multiple scores is determined as the first intent label to be confirmed using the classification network. Based on the multiple scores corresponding to the multiple intent tags and a preset formula, the entropy value corresponding to the first intent tag to be confirmed is determined. A higher entropy value indicates lower reliability of the first intent tag to be confirmed. The preset formula is as follows: , where n is the number of the plurality of intent tags. The score corresponding to the i-th intent label among the plurality of intent labels; When the entropy value is greater than or equal to a third preset threshold, the first intent tag to be confirmed is determined to be the second intent tag to be confirmed. Based on the customer's response information to the sentence corresponding to the second intent tag to be confirmed in the current conversation text, determine whether the second intent tag to be confirmed is the target intent tag; When the entropy value is less than the third preset threshold, the first intent tag to be confirmed is determined to be the target intent tag.

6. The intent recognition method according to claim 5, characterized in that, The step of determining whether the second intent tag to be confirmed is the target intent tag based on the customer's response information to the sentence corresponding to the second intent tag to be confirmed in the current conversation text includes: The response information is encoded using an encoding network in an emotion recognition model to obtain a second text representation vector corresponding to the response information; The second text representation vector is classified using the classification network in the emotion recognition model to obtain a classification result, which is used to characterize whether the emotion of the response information is positive or negative. When the classification result is positive sentiment, the second intent label to be confirmed is determined as the target intent label.

7. The intent recognition method according to claim 5, characterized in that, The method further includes: The customer's expression following the target sentence is sequentially identified as the target sentence. The step of determining the entropy value corresponding to the first intent tag to be confirmed based on the multiple scores corresponding to the multiple intent tags and the preset formula is repeated to obtain multiple target intent tags corresponding to the current conversation text. The target intent tags are sorted in ascending order of their entropy values ​​to obtain a sorting result. Select the top K target intent tags from the sorting results according to a preset quantity K as the intent tags for the session text.

8. The intent recognition method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtain multiple historical session samples corresponding to multiple intent tags; Calculate the word frequency of each word in multiple historical conversation samples corresponding to each intent tag; Words with a frequency greater than or equal to a fourth preset threshold are identified as keywords corresponding to the intent tag; The preset keyword table is constructed based on the keywords.

9. An intent recognition device, characterized in that, include: The word segmentation module is used to segment the target sentence from the client in the current conversation text to obtain at least one target word. The first determining module is used to determine whether there are words in the at least one target word that have the same characters as multiple keywords in a preset keyword list. If so, the words with the same characters are determined as candidate words. The calculation module is used to calculate the similarity value between at least one keyword contained in the target cluster of the preset keyword table and the candidate word, respectively, to obtain at least one similarity value; wherein, the preset keyword table includes multiple clusters; the target cluster is the cluster with the smallest distance between the center representation vector and the representation vector of the candidate word among the multiple clusters; The second determining module is used to determine the context information of the target sentence when there is a similarity value greater than or equal to a first preset threshold among the at least one similarity value. The context information includes multiple sentences that meet a preset quantity requirement. The recognition module is used to perform intent recognition on the target sentence based on the context information to obtain the target intent tag corresponding to the target sentence.

10. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions. The processor is used to execute the intent recognition method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the intent recognition method according to any one of claims 1 to 8.