User intention mining processing method and device and related equipment
Through text processing and hierarchical clustering of dialogue voice, smart speakers and other self-service voice service smart devices can efficiently tap user intentions, solve the problem of low user intention mining efficiency in traditional technology, and achieve more accurate and efficient understanding of user intentions.
Patent Information
- Application Number
- CN202411795134.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-14
AI Technical Summary
In traditional technology, when smart devices such as smart speakers and other self-service voice service are built with dialogue systems, the user's intention mining efficiency is low, making it difficult to accurately understand the user's intentions.
By obtaining dialogue speech, converting it into text, performing text preprocessing and word segmentation, calculating the TF-IDF value of word elements, filtering the word element sentence text, vectorizing and hierarchical clustering, and determining user intentions.
It improves the efficiency and quality of user intention mining, reduces data scale, reduces clustering interference of invalid data, and improves the intelligence level of the dialogue system.
Smart Images

Figure CN119621986A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical health, and in particular to a method, device, computer equipment and computer-readable storage medium for user intention mining. Background Art
[0002] With the development of artificial intelligence, there are more and more use scenarios for self-service voice services based on voice interaction. For example, smart speakers are widely used in the field of medical health. For example, smart speakers can be used as health management assistants to provide patients with personalized health management plans through voice interaction; in the operating room, smart speakers can use a conversational language interface to help doctors query medical information and keep the sterile environment intact; smart speakers are also widely used in home-based elderly care services. Through the Internet of Things and multi-screen interactive technology, smart speakers can provide health indicator monitoring, home video clinics and other services, support Internet health consultation, and are especially suitable for home-based healthy elderly care models. These applications not only improve the convenience and efficiency of medical services, but also provide patients with more personalized health management plans, promoting the intelligent development of medical and health services.
[0003] Among them, smart speakers are an innovative product that combines audio and artificial intelligence. Users can interact with smart speakers through voice to achieve functions including but not limited to medical and health services, music playback, smart home control, online services, etc. The technical principles of smart speakers mainly include speech recognition (Automatic Speech Recognition, ASR) and voice interaction. Speech recognition technology converts the user's voice into a digital signal and recognizes the user's voice commands. The smart speaker performs corresponding operations based on these commands. In addition, with the increase in the number of smart speaker users, manual customer service has been unable to support the growing service demand. The dialogue system on the smart speaker side can replace manual customer service to solve users' high-frequency problems. Therefore, it is necessary to build a dialogue system on the smart speaker side. When building a dialogue system, it is necessary to accurately understand the user's intentions and respond to the user's intentions.
[0004] In traditional technology, for the construction of self-service dialogue systems based on voice interaction, including but not limited to smart speakers, unsupervised or semi-supervised clustering algorithms are mainly used to mine users' potential intentions, so that the corresponding smart speakers and other smart devices can accurately understand the user's intentions in the conversation according to the pre-mined user intentions. Among the common clustering methods, the K-means clustering algorithm requires the number of cluster clusters to be set in advance, and the number of preset cluster centers and the selection of the initial point of the cluster center will affect the final clustering effect. Although the hierarchical clustering algorithm does not need to select an initial point, the time complexity of the hierarchical clustering algorithm is relatively large, and the size of the text affects the clustering time.
[0005] Therefore, how to efficiently mine user intentions has become a technical problem that needs to be urgently solved in building dialogue systems for self-service voice service smart devices such as smart speakers. Summary of the invention
[0006] The present application provides a method, apparatus, computer device and computer-readable storage medium for processing user intent mining, which can solve the technical problem of low efficiency in user intent mining when constructing a dialogue system with self-service voice service smart devices such as smart speakers in traditional technologies.
[0007] In a first aspect, the present application provides a method for processing user intent mining, comprising: obtaining a conversation voice corresponding to a self-service voice service, and converting the conversation voice into text to obtain an initial text to be mined for the user intent to be mined; performing text preprocessing on the initial text to be mined to obtain a preprocessed text to be mined; performing word segmentation on the preprocessed text to be mined in units of sentences to obtain word units; calculating the TF-IDF value of the word unit to obtain the word weight of the word unit; based on a preset text filtering algorithm and according to the word weight, filtering the word unit sentence text corresponding to the word unit to obtain a target word unit sentence text; vectorizing the target word unit sentence text to obtain a number of word unit sentence text vectors; based on the word unit sentence text vectors, determining a number of target word unit sentence text vectors, and based on a preset hierarchical clustering algorithm, clustering all the target word unit sentence text vectors to obtain cluster clusters; based on the cluster clusters and based on the user intent labeling operation, determining the corresponding target user intent.
[0008] In a second aspect, the present application provides a processing device for user intention mining, comprising: a first conversion unit, used to obtain a conversation voice corresponding to a self-service voice service, and convert the conversation voice into text to obtain an initial text to be mined for user intention to be mined; a preprocessing unit, used to perform text preprocessing on the initial text to be mined to obtain a preprocessed text to be mined; a word segmentation unit, used to perform word segmentation on the preprocessed text to be mined in units of sentences to obtain word units; a first calculation unit, used to calculate the TF-IDF value of the word unit to obtain the word weight of the word unit; a first filtering unit, Based on a preset text filtering algorithm and according to the word weight, the word-gram sentence text corresponding to the word-gram is filtered to obtain a target word-gram sentence text; a vectorization unit is used to vectorize the target word-gram sentence text to obtain a plurality of word-gram sentence text vectors; a clustering unit is used to determine a plurality of target word-gram sentence text vectors based on the word-gram sentence text vectors, and based on a preset hierarchical clustering algorithm, all the target word-gram sentence text vectors are clustered to obtain cluster clusters; a first determination unit is used to determine the corresponding target user intent based on the cluster clusters and based on the labeling operation of the user intent.
[0009] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method for processing user intent mining when executing the computer program.
[0010] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the processing method for user intention mining.
[0011] The present application provides a processing method, device, computer equipment and computer-readable storage medium for user intention mining. The method obtains the initial text to be mined of the user intention to be mined, and obtains the word weight of the corresponding word according to the TF-IDF value, and then filters the word-unit sentence text corresponding to the word according to the word weight to obtain the target word-unit sentence text, and then vectorizes the target word-unit sentence text, and determines the target word-unit sentence text vector, and then clusters all the target word-unit sentence text vectors, and then determines the target user intention based on the clustering, and can remove duplicate corpus and importance by filtering the word-unit text corresponding to the word. A lower corpus is used to reduce the data scale, reduce the clustering interference of invalid data, and improve the data quality of clustered data. When using a hierarchical clustering algorithm for clustering, it can try to avoid the large number of texts affecting the long clustering time, so that while improving the clustering efficiency of the hierarchical clustering algorithm, it can also make full use of the characteristics of the hierarchical clustering algorithm to improve the clustering quality, thereby improving the efficiency and quality of user intent mining, and improving the effect of user intent mining, which is conducive to building a high-quality dialogue system for self-service voice service smart devices such as smart speakers, thereby improving the intelligence level of self-service voice service smart devices such as smart speakers. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 A flowchart of a method for processing user intention mining provided in an embodiment of the present application;
[0014] Figure 2 A schematic diagram of the first sub-flow of the method for processing user intention mining provided in an embodiment of the present application;
[0015] Figure 3A schematic diagram of a second sub-flow of the method for processing user intention mining provided in an embodiment of the present application;
[0016] Figure 4 A schematic block diagram of a processing device for user intention mining provided in an embodiment of the present application;
[0017] Figure 5 A schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0020] An embodiment of the present application provides a method for processing user intent mining, which can be applied to computer devices including but not limited to smart speakers, smart phones, desktop computers, self-service voice devices, and the like, and can be used when building a dialogue system in self-service voice service smart devices such as smart speakers in the field of medical health, including but not limited to.
[0021] In the face of the technical problem of low efficiency in mining user intentions when building a dialogue system with self-service voice service smart devices such as smart speakers in traditional technologies, the inventor proposes a processing method for mining user intentions in an embodiment of the present application. The core idea of the embodiment of the present application is: before mining user intentions, the long text is segmented or compressed, and repeated corpus and corpus with low importance are removed to reduce the data size. Then, if there is a preset intention library, the intention corresponding to the text to be mined is preliminarily determined based on the preset intention library. Then, if there is no preset intention library, or if the intention corresponding to the text to be mined cannot be determined based on the preset intention library, the corresponding text to be mined is used to mine the user's potential intentions using a hierarchical clustering algorithm. Thereby, by reducing the data size of the hierarchical clustering algorithm used to mine the user's potential intentions as much as possible, the efficiency and effect of mining user intentions when building a dialogue system with self-service voice service smart devices such as smart speakers can be improved, thereby achieving efficient mining of user intentions.
[0022] The following will, with reference to the accompanying drawings, elaborate on some embodiments of the present application. Without conflict, the following embodiments and the features in the embodiments may be combined with each other.
[0023] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the processing method for user intention mining provided by an embodiment of the present application. As Figure 1 shown, the method includes but is not limited to the following steps S11 - S18:
[0024] S11. Obtain the dialogue voice corresponding to the self-service voice service, and convert the dialogue voice into text to obtain the initial text to be mined for the user intention.
[0025] Explanatorily, the self-service voice service is generally a voice dialogue between a user and a self-service voice service device. When performing user intention mining, it is generally also based on the above voice dialogue for user intention mining. Therefore, obtain the dialogue voice corresponding to the self-service voice service, and based on the speech recognition technology, also known as Automatic Speech Recognition (ASR), convert the dialogue voice into text to obtain the initial text to be mined for the user intention.
[0026] S12. Perform text preprocessing on the initial text to be mined to obtain the preprocessed text to be mined.
[0027] Explanatorily, in natural language processing (NLP) tasks, text preprocessing represents the process of converting the initial text data to be mined into a format that meets the input requirements of the model. Text preprocessing includes but is not limited to removing stop words. Removing stop words means removing those common but semantically meaningless words in the text. For example, removing words such as "de, he, le, a" and other meaningless words to improve the efficiency and accuracy of text processing.
[0028] According to the above description, perform text preprocessing on the initial text to be mined to obtain the preprocessed text to be mined. It should be noted that the initial text to be mined and the preprocessed text to be mined are only used to distinguish different texts and are not used to limit different texts. Other similar descriptions in the embodiments of the present application are to be understood in the same way.
[0029] S13. Segment the preprocessed text to be mined into words with sentences as units to obtain word tokens.
[0030] Explanatoryly, in natural language processing (NLP), word segmentation is the process of breaking down a text paragraph into basic language units, which are called tokens. Chinese word segmentation means dividing a sequence of Chinese characters into individual words. Word segmentation is a basic step in Chinese text processing, and its purpose is to split continuous Chinese text into independent words for subsequent text analysis and processing. Chinese word segmentation methods include but are not limited to dictionary-based word segmentation methods, understanding-based word segmentation methods, and statistics-based word segmentation methods. Chinese word segmentation tools include but are not limited to Jieba, SnowNLP, THULAC, and NLPIR.
[0031] According to the above description, the preprocessed text to be mined is segmented, generally in units of sentences, to obtain corresponding word units.
[0032] S14. Calculate the TF-IDF value of the word-gram to obtain the word weight of the word-gram.
[0033] Explanatoryly, TF-IDF (Term Frequency-Inverse Document Frequency) consists of two parts: term frequency (TF) and inverse document frequency (IDF), where term frequency (TF) refers to the frequency of a word appearing in a document, and inverse document frequency (IDF) is the total number of documents divided by the number of documents containing the word, and then taking the logarithm. The value of TF-IDF is obtained by multiplying TF and IDF.
[0034] According to the above description, the TF-IDF value of each word is calculated, and the TF-IDF value is used as the word weight of the corresponding word to obtain the word weight corresponding to the word. The word weight represents the weight of the word, specifically, the measure of the importance or relevance of each word in text processing. The word weight depends on factors such as the frequency of occurrence, importance, and relevance of the word to the topic in the text corresponding to the conversation speech. The TF-IDF calculation formula is as follows: word frequency (TF) = the number of times a word appears in the corpus / the total number of words in the corpus, inverse document frequency (IDF) = log (the number of conversations in the corpus / the number of conversations containing the word + 1), TF-IDF = TF*IDF.
[0035] Furthermore, when calculating TF-IDF, the corpus of manual customer service can be included, which can increase the data scale and make the weight value more representative. At the same time, when calculating the IDF value, all the voice-to-text conversions of a call are regarded as a whole rather than a single round of conversation. The weight of common words and subject words in the call can be increased. For example, the distribution of common conversation words such as "thank you" and "goodbye" is irrelevant to the conversation scene. They will appear in more conversation scenes, that is, the number of conversations containing the word is large. When the above method is used to calculate IDF, a smaller value is obtained. Words related to the topic of the conversation, such as "speaker" involved in smart speakers, will appear repeatedly in specific conversation scenes, which will result in a small number of conversations containing the word and a larger IDF value for the subject word.
[0036] S15. Based on a preset text filtering algorithm and according to the word weight, filter the word-gram sentence text corresponding to the word-gram to obtain the target word-gram sentence text.
[0037] Explanatoryly, a text filtering algorithm is pre-set, i.e., a preset text filtering algorithm. The preset text filtering algorithm means deleting unnecessary information from the corresponding text to improve the quality of the text. It mainly refers to an algorithm that deletes text including but not limited to unimportant text, repeated text, and low-quality text after the preprocessed text to be mined is segmented, i.e., the text corresponding to the word element. Among them, unimportant text means text with low sentence importance, repeated text means multiple texts with the same content, and low-quality text means text without keywords or text with sentence importance so low that it is not considered in order.
[0038] Based on the above conception and setting, according to the word weights corresponding to the above word-grams, when a word-gram sentence text contains several word-grams, the word weights of all word-grams are combined to evaluate the importance of the word-gram sentence text corresponding to the word-gram, and based on the preset text filtering algorithm, the word-gram sentence text corresponding to the word-gram is deleted accordingly to filter out the word-gram sentence text that does not meet expectations and obtain the target word-gram sentence text, wherein the word-gram sentence text represents the text in sentences represented by word-grams.
[0039] S16. Vectorize the target word-element sentence text to obtain a number of word-element sentence text vectors.
[0040] Explanatory, when the conversation voice contains different calls, there are generally multiple target word-lemma texts. Therefore, the target word-lemma text is vectorized to obtain several word-lemma text vectors, wherein text vectorization is to convert text data into numerical form, and the methods of text vectorization include but are not limited to Bag of Words, TF-IDF (Term Frequency-Inverse Document Frequency), and Word Embeddings.
[0041] S17, determining a number of target word-element sentence text vectors according to the word-element sentence text vectors, and clustering all the target word-element sentence text vectors based on a preset hierarchical clustering algorithm to obtain cluster clusters.
[0042] Explanatory, the pre-set hierarchical clustering algorithm, i.e., the preset hierarchical clustering algorithm, represents a clustering algorithm based on hierarchical clustering. Hierarchical clustering is an unsupervised learning algorithm used to construct a hierarchical structure of data. The core concept of hierarchical clustering is to start from a cluster consisting of a single data point, and finally form a single cluster containing all data points by continuously merging the closest cluster pairs.
[0043] Furthermore, an intent library is pre-set, namely, a preset intent library, which represents a database containing preset annotated sentence text clusters and their corresponding annotated user intents, wherein the preset annotated sentence text clusters contain a number of preset annotated sentence texts, and the annotated sentence text vectors corresponding to the preset annotated sentence texts contained in the preset intent library are determined. In this case, due to the use of a hierarchical clustering algorithm, each text is individually clustered at the beginning of the hierarchical clustering algorithm, and then the average cosine similarity of text pairs between clusters is calculated two by two, and then the clusters with the largest average cosine similarity are merged, and the calculation is stopped by iterating in this way until the largest average cosine similarity is less than a set threshold. If the threshold is too large, the data will be dispersed and similar texts will be separated. If the threshold is too small, texts with different intents will be aggregated together. The setting of the threshold can be estimated based on the preset intent library. Specifically, the average cosine similarity between different annotated user intents in the preset intent library can be calculated. degree, and select the value with the lowest average cosine similarity as the estimate of the above threshold; if there is no preset intent library, a small sample can be used to estimate the threshold. Specifically, if the expected clustering results have small differences between clusters of the same cluster and large differences between different clusters, the Calinski-Harabasz score can be used to measure the clustering effect. A small number of data samples are randomly selected, and different threshold hyperparameters are set with a step size of 0.01 for hierarchical clustering. The threshold with the highest Calinski-Harabasz score is selected as the overall threshold. The Calinski-Harabasz score represents the score based on the Calinski-Harabasz criterion. The Calinski-Harabasz criterion is a statistic used to evaluate clustering effects. It is mainly used to determine the optimal number of clusters. It evaluates the quality of clustering effects by calculating the ratio of the between-group discreteness to the within-group discreteness.
[0044] Based on the above conception and arrangement, according to a number of word-meta-sentence text vectors, a number of target word-meta-sentence text vectors are determined, that is, the set corresponding to the number of target word-meta-sentence text vectors is a subset of the set corresponding to the number of word-meta-sentence text vectors, and based on a preset hierarchical clustering algorithm, all target word-meta-sentence text vectors are clustered to obtain cluster clusters. Hierarchical clustering is used, and the clustering algorithm is stable. There is no need to preset the number of clusters and the initial point for initialization. This can improve the accuracy and quality of clustering, improve the efficiency and quality of user intent mining, and enhance the effect of user intent mining, thereby facilitating the construction of high-quality dialogue systems for self-service voice service smart devices such as smart speakers.
[0045] S18: Determine the corresponding target user intention according to the clustering clusters and based on the labeling operation of the user intention.
[0046] Explanatory, after the clusters are obtained, they are annotated by relevant personnel, and in response to the annotation operations of relevant personnel, the user intentions corresponding to the clusters are obtained, so as to determine the corresponding target user intentions based on the annotation operations of user intentions, and realize the mining of user intentions.
[0047] In an embodiment of the present application, an initial text to be mined of a user's intention to be mined is obtained, and the initial text to be mined is subjected to text preprocessing to obtain a preprocessed text to be mined, and then the preprocessed text to be mined is segmented into sentences to obtain word units, and the TF-IDF value of the word unit is calculated to obtain the word weight of the word unit, and then the word unit sentence text corresponding to the word unit is filtered according to the word weight to obtain the target word unit sentence text, and then the target word unit sentence text is vectorized to obtain a number of word unit sentence text vectors, and finally, according to the word unit sentence text vectors, a number of target word unit sentence text vectors are determined, and based on a preset hierarchical clustering algorithm, all target word unit sentence text vectors are clustered to obtain cluster clusters, and the corresponding target user intention is determined according to the cluster clusters. , it can filter the word-meta texts corresponding to the word-meta to eliminate duplicate corpus and corpus with low importance, reduce the data scale, reduce the clustering interference of invalid data, and improve the data quality of clustered data. When using the hierarchical clustering algorithm for clustering, it can try to avoid the large number of texts affecting the long clustering time, so that it can improve the clustering efficiency of the hierarchical clustering algorithm and make full use of the characteristics of the hierarchical clustering algorithm to improve the clustering quality, thereby improving the efficiency and quality of user intent mining, and improving the effect of user intent mining, which is conducive to building a high-quality dialogue system for self-service voice service smart devices such as smart speakers, thereby improving the intelligence level of self-service voice service smart devices such as smart speakers.
[0048] In one embodiment, determining a plurality of target word-element sentence text vectors according to the word-element sentence text vectors includes:
[0049] According to the word-element sentence text vector, determining whether a preset intention library contains a user intention corresponding to the word-element sentence text vector;
[0050] In the case that the preset intention library does not have the user intention corresponding to the word-element sentence text vector, the word-element sentence text vector is used as the target word-element sentence text vector to obtain a plurality of target word-element sentence text vectors;
[0051] In the case that the preset intent library contains the user intent corresponding to the word-element sentence text vector, the corresponding user intent is used as the target user intent corresponding to the word-element sentence text vector.
[0052] Explanatory, as described above, the pre-set intention library, i.e., the preset intention library, represents a database containing preset annotated sentence text clusters and their corresponding annotated user intentions, wherein the preset annotated sentence text clusters include a number of preset annotated sentence texts, wherein the preset annotated sentence texts represent the texts in units of sentences that are pre-set and annotated with user intentions, the annotated user intentions represent the user intentions annotated by relevant personnel, and the annotated user intentions Figure 1 Generally, it is the accurate user intention.
[0053] Based on the above conception and arrangement, according to the word-meta sentence text vector, and determining the annotated sentence text vector corresponding to the preset annotated sentence text contained in the preset intention library, through a similarity calculation method including but not limited to vector cosine similarity, it is judged whether the word-meta sentence text vector is similar to the annotated sentence text vectors corresponding to each of the several preset annotated sentence texts contained in the preset intention library, so as to judge whether there is a user intent corresponding to the word-meta sentence text vector in the preset intention library. When the word-meta sentence text vector is similar to the annotated sentence text vectors corresponding to each of the several preset annotated sentence texts contained in the preset intention library, it indicates that the annotated user intent corresponding to the preset annotated sentence text is acceptable. Taking the user intention of the meta-sentence text corresponding to the meta-sentence text vector as the user intention, it is determined that the preset intention library exists the user intention corresponding to the meta-sentence text vector; otherwise, when the meta-sentence text vector is not similar to the annotated sentence text vectors corresponding to several preset annotated sentence texts contained in the preset intention library, it indicates that the annotated user intentions corresponding to all the preset annotated sentence texts contained in the preset intention library cannot be used as the user intention of the meta-sentence text corresponding to the meta-sentence text vector, and thus it is determined that the preset intention library does not have the user intention corresponding to the meta-sentence text vector, that is, the preset intention library does not have the user intention corresponding to the meta-sentence text. Therefore, when the preset intention library does not contain the user intention corresponding to the word-gram sentence text vector, it indicates that other methods other than those based on the preset intention library are needed to determine the user intention corresponding to the word-gram sentence text vector, that is, the user intention of the word-gram sentence text corresponding to the word-gram sentence text vector cannot be directly determined based on the preset intention library, and then the word-gram sentence text vector is used as the target word-gram sentence text vector to obtain several target word-gram sentence text vectors, and other methods other than those based on the preset intention library are used to determine the user intention corresponding to the word-gram sentence text. Moreover, when the preset intention library contains the user intention corresponding to the word-gram sentence text vector, it indicates that the user intention corresponding to the word-gram sentence text vector can be directly determined based on the preset intention library, that is, the user intention of the word-gram sentence text corresponding to the word-gram sentence text vector can be directly determined, and the corresponding user intention is used as the target user intention corresponding to the word-gram sentence text vector, that is, the user intention of the word-gram sentence text corresponding to the word-gram sentence text vector is directly obtained.
[0054] In the embodiment of the present application, a preset intention library is used to determine whether the target user intention corresponding to the word-meta sentence text vector can be predetermined, and the word-meta sentence text vector for which the target user intention cannot be determined by the preset intention library is used as the target word-meta sentence text vector, which can further reduce the data scale of the hierarchical clustering algorithm for clustering. Not only can the efficiency of user intention mining be improved by the preset intention library, but the efficiency and quality of user intention mining can also be improved by combining the hierarchical clustering algorithm, thereby further improving the efficiency and quality of user intention mining as a whole, and improving the effect of user intention mining, which is conducive to building a high-quality dialogue system for self-service voice service smart devices such as smart speakers, thereby improving the intelligence level of self-service voice service smart devices such as smart speakers.
[0055] In one embodiment, judging whether a user intent corresponding to the word-element sentence text vector exists in a preset intent library according to the word-element sentence text vector includes:
[0056] Determine the labeled sentence text vectors corresponding to each of the plurality of preset labeled sentence texts included in the preset intention library;
[0057] Based on the preset SBERT model, calculate the similarity between the word-element sentence text vector and each of the annotated sentence text vectors;
[0058] According to all the similarities, determining whether there is a target similarity greater than or equal to a preset similarity threshold;
[0059] In the case where the target similarity exists, determining that the preset intention database contains the user intention corresponding to the word-element sentence text vector, and taking the user intention of the annotated sentence text vector corresponding to the similarity with the highest target similarity as the initial user intention of the word-element sentence text vector;
[0060] In the absence of the target similarity, it is determined that the preset intent library does not contain the user intent corresponding to the word-element sentence text vector.
[0061] Explanatoryly, the SBERT model is pre-set, that is, the SBERT model is preset. SBERT (Sentence-BERT) is a model for sentence pair classification and calculating the similarity between two sentences.
[0062] According to the above settings and descriptions, and with reference to the description of the above preset intent library, the annotated sentence text vectors corresponding to each of the several preset annotated sentence texts contained in the preset intent library are determined to obtain several annotated sentence text vectors, and based on the preset SBERT model, the similarity between the word-element sentence text vector and each annotated sentence text vector is calculated, and based on all the above similarities, it is determined whether each similarity is greater than or equal to the preset similarity threshold to determine whether there is a target similarity greater than or equal to the preset similarity threshold. In the case where the above similarity is greater than or equal to the preset similarity threshold, it indicates that the word-element sentence text vector is similar to the corresponding annotated sentence text vector, and the similarity is used as the target similarity, and it is determined that there is a target similarity greater than or equal to the preset similarity threshold. Otherwise, in the case where all the above similarities are less than the preset similarity threshold, it indicates that the word-element sentence text vector and the corresponding annotated sentence text vector are not similar, all the above similarities are not used as the target similarity, and it is determined that there is no target similarity greater than or equal to the preset similarity threshold.
[0063] Moreover, when there is target similarity, it is determined that the preset intent library contains the user intent corresponding to the word-gram sentence text vector, and the user intent of the annotated sentence text vector corresponding to the similarity with the highest target similarity is used as the corresponding initial user intent of the word-gram sentence text vector, that is, the user intent of the annotated sentence text vector with the highest similarity is used as the initial user intent of the word-gram sentence text vector, and is used for manual verification or annotation to maximize the accuracy of the target user intent corresponding to the word-gram sentence text vector. When there is no target similarity, it is determined that the preset intent library does not contain the user intent corresponding to the word-gram sentence text vector.
[0064] Further, as described above, an intent library is pre-set, i.e., a preset intent library, which represents a database containing preset annotated sentence text clusters and their corresponding annotated user intents, wherein the preset annotated sentence text clusters contain a number of preset annotated sentence texts, and the annotated sentence text vector corresponding to the preset annotated sentence text contained in the preset intent library is determined. In this case, the above-mentioned pre-trained preset SBERT model is fine-tuned based on the preset intent library. Specifically, based on the preset intent library, two preset annotated sentence texts and labels [S A ,S B , label], the preset annotated sentence text pairs from the same annotated user intention are positive examples, and the label value label is set to 0.98, and the preset annotated sentence texts from different annotated user intentions are negative examples, and the label value label is set to 0.1. A ,S B] The input is input into the same preset SBERT model, and two vectors (u, v) are output. The mean square error MSE is used as the loss function to calculate the cosine similarity of the output vector and the difference between the labels, that is, Loss = MES (cosin (u, v), label), to fine-tune the preset SBERT model. This can make the pre-trained SBERT model more adaptable to the intent mining environment corresponding to the preset intent library, so as to improve the efficiency and quality of user intent mining.
[0065] In addition, the above-mentioned preset similarity threshold can be set according to the scale of the preset intent library. When the preset intent library has less data, a smaller preset similarity threshold can be set. When the preset intent library is more complete and the data scale is larger, a larger preset similarity threshold can be set. That is, the size of the preset similarity threshold is positively correlated with the data scale of the preset intent library. If there is no preset intent library, this step is skipped, but the preset similarity threshold is set to 0.8 by default.
[0066] The embodiments of the present application, based on a preset intent library and a preset SBERT model, can fully utilize the characteristics of the preset intent library and the SBERT model to improve the efficiency and accuracy of the corresponding user intent mining, thereby further improving the efficiency and quality of user intent mining as a whole, and enhancing the effect of user intent mining.
[0067] See also Figure 2 , Figure 2 This is a schematic diagram of the first sub-flow of the method for processing user intention mining provided in the embodiment of the present application. Figure 2 As shown, in this embodiment, based on a preset text filtering algorithm and according to the word weight, the word-element sentence text corresponding to the word-element is filtered to obtain the target word-element sentence text, including:
[0068] S21, according to the word-gram sentence text corresponding to the word-gram, determine the word-gram long sentence text, and convert the word-gram long sentence text into a short sentence text to obtain the word-gram short sentence text corresponding to the word-gram long sentence text, and use the word-gram short sentence text and other word-gram sentence texts as the first target sentence;
[0069] S22, counting the sentence length of the first target sentence, and determining the first target sentence whose sentence length is greater than a preset first length threshold as the second target sentence;
[0070] S23. Divide the second target sentence according to the preset first punctuation mark to obtain clauses corresponding to the second target sentence;
[0071] S24, based on a preset sentence importance algorithm and according to the word weight, determining the sentence weight of the clause;
[0072] S25. Delete the clauses with lower sentence weights in sequence until the length of the second target sentence is less than or equal to the preset first length threshold, or the second target sentence contains only one clause, to obtain the target word-element sentence text.
[0073] Explanatoryly, a sentence importance algorithm is pre-set, that is, a preset sentence importance algorithm, which represents an algorithm for quantifying and counting the importance of sentences, wherein an algorithm is a method and step for solving a problem, and the preset sentence importance algorithm includes but is not limited to ExtRank algorithm, Keybert algorithm, Yake algorithm, and an algorithm using TF-IDF value.
[0074] According to the above-mentioned conception and arrangement, the word-gram long sentence text is determined according to the word-gram sentence text corresponding to the word-gram, the word-gram long sentence text means the text which uses words as sentence components to represent the text and the length of the text exceeds a certain length threshold, and the word-gram long sentence text is segmented to be converted into short sentence text, and the word-gram short sentence text corresponding to the word-gram long sentence text is obtained. Corresponding to the word-gram long sentence text, the word-gram short sentence text means the text which uses words as sentence components to represent the text and the length of the text does not exceed a certain length threshold, and the word-gram long sentence text is determined, generally, part of the text whose length exceeds a certain length threshold is screened out from several word-gram sentence texts corresponding to the word-gram, and part of the text whose length does not exceed a certain length threshold in several word-gram sentence texts corresponding to the word-gram is called other word-gram sentence text, and the word-gram short sentence text and other word-gram sentence texts are taken as the first target sentence together, and the first target sentences are all relative short sentence texts. In actual conversations, users may use a very long description to explain the problems they encounter. From the perspective of speech-to-text conversion, long text is composed of many short sentences. Compared with normal text, long text contains richer information and may contain multiple user intentions. At the same time, there may also be many meaningless short sentences. Therefore, converting the word-unit long sentence text into short sentence text can make full use of the rich information contained in the word-unit long sentence text and the multiple possible user intentions. At the same time, it can also effectively eliminate the meaningless short sentences and improve data quality.
[0075] The sentence length of the first target sentence is counted, and the first target sentence whose sentence length is greater than a preset first length threshold is determined as the second target sentence, that is, the sentence set corresponding to the second target sentence is a subset of the sentence set corresponding to the first target sentence, and the length thresholds of the word-unit long sentence text, the first target sentence, and the second target sentence are reduced in sequence, and then the second target sentence is divided according to the preset first punctuation mark, which includes but is not limited to the Chinese punctuation mark "," to obtain the clauses corresponding to the second target sentence, so as to segment the second target sentence.
[0076] As described above, based on the preset sentence importance algorithm and according to the word weight, the sentence weight of the clause is determined, wherein the word weight represents the importance of the corresponding word unit, and the sentence weight represents the importance of the corresponding sentence. Then, the above-mentioned sentences with lower sentence weights are deleted in turn until the length of the second target sentence is less than or equal to the preset first length threshold, or the second target sentence contains only one sentence, and the target word unit sentence text is obtained, thereby achieving compression of relatively long sentences by deleting unimportant clauses in the sentence, thereby effectively shortening the length of the sentence.
[0077] The embodiment of the present application effectively shortens the sentence length of the corresponding text by converting long sentence text into short sentence text and deleting unimportant clauses. This can not only make full use of the rich information contained in the long sentence text and the various possible user intentions, but also effectively eliminate the short sentences with meaningless parts, thereby improving the data quality for user intention mining, improving the efficiency and quality of user intention mining, and enhancing the effect of user intention mining.
[0078] In one embodiment, based on a preset sentence importance algorithm and according to the word weight, determining the sentence weight of the clause includes:
[0079] Determining a word sequence corresponding to the sentence;
[0080] Calculate the sum S of the word weights of all word units contained in the word unit sequence;
[0081] The sentence weight of the sentence is calculated according to the following formula (1):
[0082]
[0083] Where Sw represents the sentence weight of the clause, S represents the sum of the word weights of all word units contained in the word unit sequence, and d S Indicates the sentence length of the clause.
[0084] Explanatory, determine the word-gram sequence corresponding to the sentence. The sentence contains several word-grams. Correspondingly, the word-gram sequence also contains several word-grams. As mentioned above, calculate the TF-IDF value of the word-gram to obtain the word weight of the word-gram to determine the word weight of the word-gram. Then calculate the sum of the word weights of all the word-grams contained in the word-gram sequence, which can be represented by S. The sentence weight of the sentence is calculated using the following formula (1):
[0085]
[0086] Among them, Sw represents the sentence weight of the clause, represents the calculated score of the sentence importance, S represents the sum of the word weights of all word units contained in the word unit sequence, and d S Indicates the sentence length of the clause.
[0087] In the embodiment of the present application, the sentence weight of the sentence is determined in the above manner, which can not only fully reflect the importance of the sentence by comprehensively measuring the importance of the keywords in the sentence, but also effectively reduce the score of long sentences containing more words, thereby reducing the influence of long sentences on user intent mining, and can further improve the accuracy of user intent mining, thereby further improving the quality of user intent mining, to enhance the effect of user intent mining.
[0088] See also Figure 3 , Figure 3 This is a schematic diagram of the first sub-flow of the method for processing user intention mining provided in the embodiment of the present application. Figure 3 As shown, in this embodiment, the clauses with lower sentence weights are deleted in sequence until the length of the second target sentence is less than or equal to the preset first length threshold, or the second target sentence contains only one clause, to obtain the target word-element sentence text, including:
[0089] S31, sequentially deleting the clauses with lower sentence weights until the length of the second target sentence is less than or equal to a preset first length threshold, or the second target sentence contains only one clause, to obtain a first intermediate word meta-sentence text;
[0090] S32, identifying repeated sentences according to the first intermediate word meta-sentence text and other target sentences included in the first target sentence except the second target sentence, and deleting the repeated sentences to obtain a plurality of second intermediate word meta-sentence texts;
[0091] S33, determining the middle sentence weight corresponding to the second middle word meta-sentence text based on the preset sentence importance algorithm;
[0092] S34, sorting all the second middle word meta-sentence texts according to the order of the middle sentence weights from small to large, to obtain a second middle word meta-sentence text sequence;
[0093] S35 . Based on the second intermediate word meta-sentence text sequence and according to a preset sentence text deletion condition, delete the second intermediate word meta-sentence text with a smaller intermediate sentence weight to obtain a target word meta-sentence text.
[0094] Explanatoryly, clauses with lower sentence weights are deleted in sequence until the length of the second target sentence is less than or equal to the preset first length threshold, or the second target sentence contains only one clause, to obtain a first intermediate word meta-sentence text. The "first" involved in the first intermediate word meta-sentence text is only used to distinguish different intermediate word meta-sentence texts, and is not used to limit the intermediate word meta-sentence text. The same applies to other similar descriptions in the embodiments of the present application. In addition, the intermediate word meta-sentence text represents the word meta-sentence text generated in the process of user intention mining, and is only used to distinguish different word meta-sentence texts, and is not used to limit different word meta-sentence texts. The same applies to other similar descriptions in the embodiments of the present application.
[0095] Since the second target sentence is a sentence selected from the first target sentence and the length of which is greater than the preset first length threshold, that is, the sentence set corresponding to the second target sentence is a subset of the sentence set corresponding to the first target sentence, therefore, in general, the sentence set corresponding to the first target sentence contains other first target sentences in addition to the second target sentence, which are called other target sentences, and then according to the first intermediate word meta-sentence text and other target sentences in addition to the second target sentence contained in the first target sentence, the repeated sentences are identified and deleted to obtain several second intermediate word meta-sentence texts, the expression of the second intermediate word meta-sentence text is similar to the first intermediate word meta-sentence text, wherein the repeated sentences represent the existence of multiple identical sentences. Exemplarily, assuming that A and B are the same sentence, then B is a repeated sentence relative to A, and B is deleted.
[0096] The preset sentence importance algorithm as described above is used, and then based on the preset sentence importance algorithm, the middle sentence weight corresponding to the second middle word meta-sentence text is determined, and all the second middle word meta-sentence texts are sorted in order from small to large according to the middle sentence weight to obtain a second middle word meta-sentence text sequence, the second middle word meta-sentence text sequence includes a plurality of second middle word meta-sentence texts, and finally based on the second middle word meta-sentence text sequence and according to the preset sentence text deletion condition, the second middle word meta-sentence text with a smaller middle sentence weight is deleted to obtain the target word meta-sentence text, wherein the preset sentence text deletion condition represents a preset condition for deleting the text corresponding to the corresponding sentence, and the preset sentence text deletion condition includes but is not limited to deleting the second middle word meta-sentence text with a middle sentence weight of 0 or a lower middle sentence weight, that is, a certain number of the second middle word meta-sentence texts ranked at the top, or deleting the second middle word meta-sentence text according to the proportion of meaningless samples observed in the sampling, and correspondingly, selecting the second middle word meta-sentence text according to the proportion of meaningful samples observed in the sampling, to filter out low-quality corresponding text data.
[0097] In addition, if you need to select texts containing certain words, you can set the corresponding TF-IDF value to infinity.
[0098] The embodiment of the present application can filter out low-quality data by deleting clauses with lower sentence weights and deleting the second middle word sentence text with smaller middle sentence weights. This can not only reduce the data size, but also improve the quality of the corresponding data, improve the efficiency and quality of user intent mining, and improve the effect of user intent mining, which is conducive to building a high-quality dialogue system for self-service voice service smart devices such as smart speakers, thereby improving the intelligence level of self-service voice service smart devices such as smart speakers.
[0099] In one embodiment, according to the word-gram sentence text corresponding to the word-gram, determining the word-gram long sentence text, and converting the word-gram long sentence text into a short sentence text to obtain the word-gram short sentence text corresponding to the word-gram long sentence text includes:
[0100] Counting the length of the word-gram sentence text corresponding to the word-gram;
[0101] Determine the word-unit sentence text whose length is greater than or equal to a preset second length threshold as a word-unit long sentence text, wherein the preset second length threshold is greater than the preset first length threshold;
[0102] According to the preset second punctuation mark, the word-unit long sentence text is segmented to obtain the word-unit short sentence text corresponding to the word-unit long sentence text.
[0103] Explanatoryly, the length of the word-gram sentence text corresponding to the word-gram is counted, and the word-gram sentence text with a length greater than or equal to a preset second length threshold is determined as the word-gram long sentence text, wherein the preset second length threshold is greater than the preset first length threshold, and according to the preset second punctuation mark, the preset second punctuation mark includes but is not limited to ".", "!", "?", the word-gram long sentence text is segmented to obtain the word-gram short sentence text corresponding to the word-gram long sentence text, thereby converting the word-gram long sentence text into a short sentence text, which can avoid the situation where the long text contains multiple user intentions, thereby making the user intention of the word-gram short sentence text more focused, and the processing efficiency of the short sentence text is higher, thereby improving the efficiency and accuracy of the corresponding user intention mining, thereby improving the efficiency and quality of user intention mining, and enhancing the effect of user intention mining.
[0104] The embodiment of the present application converts long sentence text into short sentence text by segmenting long sentence text into word-unit text, thereby effectively shortening the sentence length of the corresponding text, improving the data quality for user intent mining, improving the efficiency and quality of user intent mining, and enhancing the effect of user intent mining.
[0105] It should be noted that the processing method of user intention mining described in the above embodiments can recombine the technical features contained in different embodiments as needed to obtain a combined implementation plan, but all are within the scope of protection required by this application.
[0106] See also Figure 4 , Figure 4 A schematic block diagram of a processing device for user intention mining provided in an embodiment of the present application. Corresponding to the above-mentioned processing method for user intention mining, an embodiment of the present application also provides a processing device for user intention mining. Figure 4 As shown, the user intention mining processing device includes a unit for executing the above-mentioned user intention mining processing method, and the user intention mining processing device can be configured in a computer device including but not limited to a wearable blood pressure monitoring device, a smart phone, a server, and a cloud platform. Specifically, please refer to Figure 4 The user intention mining processing device 40 includes a first conversion unit 41, a preprocessing unit 42, a word segmentation unit 43, a first calculation unit 44, a first filtering unit 45, a vectorization unit 46, a clustering unit 47 and a first determination unit 48.
[0107] The first conversion unit 41 is used to obtain the conversation voice corresponding to the self-service voice service, and convert the conversation voice into text to obtain the initial text to be mined of the user intention to be mined;
[0108] A preprocessing unit 42 is used to perform text preprocessing on the initial text to be mined to obtain a preprocessed text to be mined;
[0109] A word segmentation unit 43 is used to segment the preprocessed text to be mined into sentences to obtain word units;
[0110] A first calculation unit 44 is used to calculate the TF-IDF value of the word-gram to obtain the word weight of the word-gram;
[0111] A first filtering unit 45 is used to filter the word-gram sentence text corresponding to the word-gram based on a preset text filtering algorithm and according to the word weight to obtain a target word-gram sentence text;
[0112] A vectorization unit 46, used for vectorizing the target word-element sentence text to obtain a plurality of word-element sentence text vectors;
[0113] A clustering unit 47 is used to determine a number of target word-element sentence text vectors according to the word-element sentence text vectors, and cluster all the target word-element sentence text vectors based on a preset hierarchical clustering algorithm to obtain cluster clusters;
[0114] The first determining unit 48 is configured to determine a corresponding target user intention according to the clusters and based on the labeling operation of the user intention.
[0115] In one embodiment, the clustering unit 47 includes:
[0116] A first judgment subunit is used to judge whether there is a user intention corresponding to the word-element sentence text vector in a preset intention library according to the word-element sentence text vector;
[0117] The first determination subunit is used to, when the above judgment is no, use the word-element sentence text vector as the target word-element sentence text vector to obtain a plurality of target word-element sentence text vectors.
[0118] In one embodiment, the clustering unit 47 further includes:
[0119] The second determining subunit is used to use the corresponding user intent as the target user intent corresponding to the word-element sentence text vector when the preset intent database contains the user intent corresponding to the word-element sentence text vector.
[0120] In one embodiment, the first filtering unit 45 comprises:
[0121] A third determining subunit is used to determine a word-gram long sentence text according to the word-gram sentence text corresponding to the word-gram, and convert the word-gram long sentence text into a short sentence text to obtain a word-gram short sentence text corresponding to the word-gram long sentence text, and use the word-gram short sentence text and other word-gram sentence texts as the first target sentence;
[0122] A first statistical subunit is used to count the sentence length of the first target sentence, and determine the first target sentence whose sentence length is greater than a preset first length threshold as the second target sentence;
[0123] a dividing subunit, configured to divide the second target sentence according to a preset first punctuation mark to obtain clauses corresponding to the second target sentence;
[0124] A fourth determination subunit, configured to determine the sentence weight of the clause based on a preset sentence importance algorithm and according to the word weight;
[0125] The first deletion subunit is used to delete the clauses with lower sentence weights in sequence until the length of the second target sentence is less than or equal to a preset first length threshold, or the second target sentence contains only one clause, to obtain a target word-element sentence text.
[0126] In one embodiment, the fourth determining subunit includes:
[0127] A fifth determining subunit, used to determine a word sequence corresponding to the sentence;
[0128] A first calculation subunit, configured to calculate the sum S of the word weights of all word units included in the word unit sequence;
[0129] The second calculation subunit is used to calculate the sentence weight of the sentence according to the following formula (1):
[0130]
[0131] Where Sw represents the sentence weight of the clause, S represents the sum of the word weights of all word units contained in the word unit sequence, and d S Indicates the sentence length of the clause.
[0132] In one embodiment, the first deletion subunit includes:
[0133] A second deleting subunit is used to delete the clauses with lower sentence weights in sequence until the length of the second target sentence is less than or equal to a preset first length threshold, or the second target sentence contains only one clause, to obtain a first intermediate word meta-sentence text;
[0134] A third deletion subunit is used to identify repeated sentences according to the first intermediate word meta-sentence text and other target sentences included in the first target sentence except the second target sentence, and delete the repeated sentences to obtain a plurality of second intermediate word meta-sentence texts;
[0135] A sixth determining subunit, configured to determine the middle sentence weight corresponding to the second middle word meta-sentence text based on the preset sentence importance algorithm;
[0136] A sorting subunit, used to sort all the second middle word meta-sentence texts according to the order of the middle sentence weights from small to large, to obtain a second middle word meta-sentence text sequence;
[0137] The fourth deletion subunit is used to delete the second middle word meta-sentence text with a smaller middle sentence weight based on the second middle word meta-sentence text sequence and according to a preset sentence text deletion condition to obtain a target word meta-sentence text.
[0138] In one embodiment, the third determining subunit includes:
[0139] A second statistical subunit is used to count the length of the word-gram sentence text corresponding to the word-gram;
[0140] A seventh determination subunit is used to determine the word-unit sentence text whose length is greater than or equal to a preset second length threshold as a word-unit long sentence text, wherein the preset second length threshold is greater than the preset first length threshold;
[0141] The segmentation subunit is used to segment the word-unit long sentence text according to a preset second punctuation mark to obtain the word-unit short sentence text corresponding to the word-unit long sentence text.
[0142] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the processing device and each unit of the above-mentioned user intention mining can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0143] At the same time, the division and connection method of each unit in the above-mentioned user intention mining processing device is only for illustrative purposes. In other embodiments, the user intention mining processing device can be divided into different units as needed, and the units in the user intention mining processing device can also adopt different connection orders and methods to complete all or part of the functions of the above-mentioned user intention mining processing device.
[0144] The above-mentioned user intention mining processing device can be implemented in the form of a computer program. The computer program can be used in Figure 5 Runs on the computer device shown.
[0145] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a computer device such as a desktop computer or a server, or may be a component or part in other devices.
[0146] See also Figure 5 The computer device 500 includes a processor 502, a memory and a network interface 505 connected via a system bus 501, wherein the memory may include a non-volatile storage medium 503 and an internal memory 504, and the memory may also be a volatile storage medium.
[0147] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute a processing method for mining user intentions.
[0148] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0149] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the above-mentioned user intention mining processing method.
[0150] The network interface 505 is used to communicate with other devices over the network. Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation on the computer device 500 to which the present application scheme is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor. In such an embodiment, the structure and function of the memory and the processor are the same as those of the present application scheme. Figure 5 The embodiments shown are consistent and will not be described again here.
[0151] The processor 502 is used to run a computer program 5032 stored in a memory to implement the following steps: obtaining a conversation voice corresponding to the self-service voice service, and converting the conversation voice into text to obtain an initial text to be mined for the user intention to be mined; performing text preprocessing on the initial text to be mined to obtain a preprocessed text to be mined; performing word segmentation on the preprocessed text to be mined in units of sentences to obtain word units; calculating the TF-IDF value of the word unit to obtain the word weight of the word unit; based on a preset text filtering algorithm and according to the word weight, filtering the word unit sentence text corresponding to the word unit to obtain a target word unit sentence text; vectorizing the target word unit sentence text to obtain a number of word unit sentence text vectors; determining a number of target word unit sentence text vectors based on the word unit sentence text vectors, and clustering all the target word unit sentence text vectors based on a preset hierarchical clustering algorithm to obtain cluster clusters; determining the corresponding target user intention based on the cluster clusters and based on the annotation operation of the user intention.
[0152] In one embodiment, when the processor 502 determines a plurality of target word-element sentence text vectors according to the word-element sentence text vector, the processor 502 specifically implements the following steps:
[0153] According to the word-element sentence text vector, determining whether a preset intention library contains a user intention corresponding to the word-element sentence text vector;
[0154] In the case of the above judgment being no, the word-element sentence text vector is used as the target word-element sentence text vector to obtain a plurality of target word-element sentence text vectors.
[0155] In one embodiment, the processor 502 further implements the following steps when determining whether the preset intention library contains the user intention corresponding to the word-element sentence text vector:
[0156] In the case that the preset intent library contains the user intent corresponding to the word-element sentence text vector, the corresponding user intent is used as the target user intent corresponding to the word-element sentence text vector.
[0157] In one embodiment, the processor 502 implements the following steps when filtering the word-gram sentence text corresponding to the word-gram based on the preset text filtering algorithm and according to the word weight to obtain the target word-gram sentence text:
[0158] Determine a long sentence text of the word unit according to the word unit sentence text corresponding to the word unit, and convert the long sentence text of the word unit into a short sentence text to obtain a word unit short sentence text corresponding to the long sentence text of the word unit, and use the word unit short sentence text and other word unit sentence texts as the first target sentence;
[0159] Counting the sentence length of the first target sentence, and determining the first target sentence whose sentence length is greater than a preset first length threshold as the second target sentence;
[0160] Dividing the second target sentence according to the preset first punctuation mark to obtain clauses corresponding to the second target sentence;
[0161] Based on a preset sentence importance algorithm and according to the word weight, determining the sentence weight of the clause;
[0162] The clauses with lower sentence weights are deleted in sequence until the length of the second target sentence is less than or equal to the preset first length threshold, or the second target sentence contains only one clause, to obtain the target word-element sentence text.
[0163] In one embodiment, when the processor 502 implements a preset sentence importance algorithm and determines the sentence weight of the clause according to the word weight, the processor 502 specifically implements the following steps:
[0164] Determining a word sequence corresponding to the sentence;
[0165] Calculate the sum S of the word weights of all word units contained in the word unit sequence;
[0166] The sentence weight of the sentence is calculated according to the following formula (1):
[0167]
[0168] Where Sw represents the sentence weight of the clause, S represents the sum of the word weights of all word units contained in the word unit sequence, and d S Indicates the sentence length of the clause.
[0169] In one embodiment, the processor 502 implements the following steps when sequentially deleting the clauses with lower sentence weights until the length of the second target sentence is less than or equal to the preset first length threshold, or the second target sentence contains only one clause, and obtaining the target word-element sentence text:
[0170] Deleting the clauses with lower sentence weights in sequence until the length of the second target sentence is less than or equal to a preset first length threshold, or the second target sentence contains only one clause, to obtain a first intermediate word meta-sentence text;
[0171] According to the first intermediate word meta-sentence text and other target sentences included in the first target sentence except the second target sentence, duplicate sentences are identified and the duplicate sentences are deleted to obtain a plurality of second intermediate word meta-sentence texts;
[0172] Based on the preset sentence importance algorithm, determining the middle sentence weight corresponding to the second middle word meta-sentence text;
[0173] Sort all the second middle word sentence texts according to the order of the middle sentence weights from small to large to obtain a second middle word sentence text sequence;
[0174] Based on the second intermediate word meta-sentence text sequence and according to a preset sentence text deletion condition, the second intermediate word meta-sentence text with a smaller intermediate sentence weight is deleted to obtain a target word meta-sentence text.
[0175] In one embodiment, the processor 502 implements the following steps when determining the word-gram long sentence text according to the word-gram sentence text corresponding to the word-gram, converting the word-gram long sentence text into a short sentence text, and obtaining the word-gram short sentence text corresponding to the word-gram long sentence text:
[0176] Counting the length of the word-gram sentence text corresponding to the word-gram;
[0177] Determine the word-unit sentence text whose length is greater than or equal to a preset second length threshold as a word-unit long sentence text, wherein the preset second length threshold is greater than the preset first length threshold;
[0178] According to the preset second punctuation mark, the word-unit long sentence text is segmented to obtain the word-unit short sentence text corresponding to the word-unit long sentence text.
[0179] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0180] Those skilled in the art will appreciate that all or part of the processes in the method for implementing the above embodiment can be completed by a computer program, which can be stored in a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0181] Therefore, the present application also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, and the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
[0182] A computer program product, when running on a computer, enables the computer to execute the steps of the processing method for user intention mining described in the above embodiments.
[0183] The computer-readable storage medium may be an internal storage unit of the aforementioned device, such as a hard disk or memory of the device. The computer-readable storage medium may also be an external storage device of the device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the device and an external storage device.
[0184] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0185] The storage medium is a physical, non-transient storage medium, for example, it can be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, etc., which can store computer programs.
[0186] Those of ordinary skill 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, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. 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 to be beyond the scope of this application.
[0187] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0188] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present 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.
[0189] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for an electronic device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0190] The software tools or components not provided by our company that appear in the embodiments of this application are merely examples and do not represent actual use.
[0191] The relevant data collection appearing in the embodiments of the present application complies with the requirements of relevant laws and regulations, such as GDPR (General Data Protection Regulation of the European Union) or information security standards of other countries and regions.
[0192] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for user intention mining, characterized in that: include: Acquire the conversation voice corresponding to the self-service voice service, and convert the conversation voice into text to obtain the initial text to be mined for the user intention to be mined; Performing text preprocessing on the initial text to be mined to obtain a preprocessed text to be mined; Segmenting the preprocessed text to be mined into sentences to obtain word units; Calculate the TF-IDF value of the word-gram to obtain the word weight of the word-gram; Based on a preset text filtering algorithm and according to the word weight, the word-element sentence text corresponding to the word-element is filtered to obtain the target word-element sentence text; Vectorizing the target word-element sentence text to obtain a number of word-element sentence text vectors; According to the word-element sentence text vector, a number of target word-element sentence text vectors are determined, and based on a preset hierarchical clustering algorithm, all the target word-element sentence text vectors are clustered to obtain cluster clusters; According to the clusters and based on the labeling operation of the user intention, the corresponding target user intention is determined.
2. The method for processing user intention mining according to claim 1, characterized in that: According to the word-element sentence text vector, a plurality of target word-element sentence text vectors are determined, including: According to the word-element sentence text vector, determining whether a preset intention library contains a user intention corresponding to the word-element sentence text vector; In the case of the above judgment being no, the word-element sentence text vector is used as the target word-element sentence text vector to obtain a plurality of target word-element sentence text vectors.
3. The method for processing user intention mining according to claim 2, characterized in that: Determining whether the preset intention library contains the user intention corresponding to the word-element sentence text vector also includes: In the case that the preset intent library contains the user intent corresponding to the word-element sentence text vector, the corresponding user intent is used as the target user intent corresponding to the word-element sentence text vector.
4. The method for processing user intention mining according to any one of claims 1 to 3, characterized in that: Based on a preset text filtering algorithm and according to the word weight, the word-element sentence text corresponding to the word-element is filtered to obtain the target word-element sentence text, including: Determine a long sentence text of the word unit according to the word unit sentence text corresponding to the word unit, and convert the long sentence text of the word unit into a short sentence text to obtain a word unit short sentence text corresponding to the long sentence text of the word unit, and use the word unit short sentence text and other word unit sentence texts as the first target sentence; Counting the sentence length of the first target sentence, and determining the first target sentence whose sentence length is greater than a preset first length threshold as the second target sentence; Dividing the second target sentence according to the preset first punctuation mark to obtain clauses corresponding to the second target sentence; Based on a preset sentence importance algorithm and according to the word weight, determining the sentence weight of the clause; The clauses with lower sentence weights are deleted in sequence until the length of the second target sentence is less than or equal to the preset first length threshold, or the second target sentence contains only one clause, to obtain the target word-element sentence text.
5. The method for processing user intention mining according to claim 4, characterized in that: Based on a preset sentence importance algorithm and according to the word weight, the sentence weight of the clause is determined, including: Determining a word sequence corresponding to the sentence; Calculate the sum S of the word weights of all word units contained in the word unit sequence; The sentence weight of the sentence is calculated according to the following formula (1): Where Sw represents the sentence weight of the clause, S represents the sum of the word weights of all word units contained in the word unit sequence, and d S Indicates the sentence length of the clause.
6. The method for processing user intention mining according to claim 4, characterized in that: The clauses with lower sentence weights are deleted sequentially until the length of the second target sentence is less than or equal to a preset first length threshold, or the second target sentence contains only one clause, to obtain a target word-element sentence text, including: Deleting the clauses with lower sentence weights in sequence until the length of the second target sentence is less than or equal to a preset first length threshold, or the second target sentence contains only one clause, to obtain a first intermediate word meta-sentence text; According to the first intermediate word meta-sentence text and other target sentences included in the first target sentence except the second target sentence, duplicate sentences are identified and the duplicate sentences are deleted to obtain a plurality of second intermediate word meta-sentence texts; Based on the preset sentence importance algorithm, determining the middle sentence weight corresponding to the second middle word meta-sentence text; Sort all the second middle word sentence texts according to the order of the middle sentence weights from small to large to obtain a second middle word sentence text sequence; Based on the second intermediate word meta-sentence text sequence and according to a preset sentence text deletion condition, the second intermediate word meta-sentence text with a smaller intermediate sentence weight is deleted to obtain a target word meta-sentence text.
7. The method for processing user intention mining according to claim 4, characterized in that: Determining a word-unit long sentence text according to the word-unit sentence text corresponding to the word-unit, and converting the word-unit long sentence text into a short sentence text to obtain a word-unit short sentence text corresponding to the word-unit long sentence text, including: Counting the length of the word-gram sentence text corresponding to the word-gram; Determine the word-unit sentence text whose length is greater than or equal to a preset second length threshold as a word-unit long sentence text, wherein the preset second length threshold is greater than the preset first length threshold; According to the preset second punctuation mark, the word-unit long sentence text is segmented to obtain the word-unit short sentence text corresponding to the word-unit long sentence text.
8. A processing device for user intention mining, characterized in that: include: A first conversion unit is used to obtain the conversation voice corresponding to the self-service voice service, and convert the conversation voice into text to obtain an initial text to be mined for the user intention to be mined; A preprocessing unit, used for performing text preprocessing on the initial text to be mined to obtain a preprocessed text to be mined; A word segmentation unit, used to segment the preprocessed text to be mined into sentences to obtain word units; A first calculation unit, used to calculate the TF-IDF value of the word-gram to obtain the word weight of the word-gram; A first filtering unit, configured to filter the word-gram sentence text corresponding to the word-gram based on a preset text filtering algorithm and according to the word weight, to obtain a target word-gram sentence text; A vectorization unit, used for vectorizing the target word-element sentence text to obtain a plurality of word-element sentence text vectors; A clustering unit, used to determine a number of target word-element sentence text vectors according to the word-element sentence text vectors, and cluster all the target word-element sentence text vectors based on a preset hierarchical clustering algorithm to obtain cluster clusters; The first determining unit is used to determine the corresponding target user intention according to the clustering clusters and based on the labeling operation of the user intention.
9. A computer device, characterized in that: The computer device comprises a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program to execute the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 can be implemented.
Citation Information
Cited By
Conversation service method and system for user intention recognition in social interaction
CN121117152A