Intention classification method, device, equipment and storage medium based on voting decision
Through the intent classification method based on voting decisions, the deep learning algorithm is used to calculate the scores of candidate historical texts and sort them, which solves the problem that existing systems need to conduct model training when adding intent categories, and realizes efficient and convenient intent classification.
Patent Information
- Application Number
- CN202010149506.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-06
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2040-03-06
AI Technical Summary
The existing intention classification system requires additional model training when adding intent categories, resulting in low convenience in intent classification.
The intent classification method based on voting decisions is adopted, and the pre-labeled intent categories is extracted by keywords of the to be processed text, and the deep learning template semantic similarity and syntactic similarity algorithm is used to calculate the scores of candidate historical texts, and sort and voting decisions are made to obtain the pre-labeled intent categories in the target historical text.
It realizes the classification of new intent categories without model training, improves the convenience of intent classification, and improves the accuracy of matching through unsupervised computing and deep learning template matching.
Smart Images

Figure CN111444722B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing, and in particular to a method, device, equipment and storage medium for intent classification based on voting decisions. Background Art
[0002] Intent classification is an important part of the human-computer dialogue field. In the human-computer interaction system, the user's input content must be identified and classified by the intent classification system, and the user's input content must be classified into accurate intents before subsequent tasks can be carried out. The intent classification system determines the upper limit of the entire human-computer dialogue system. Therefore, improving the universality and robustness of the intent classification system can greatly improve the service quality of the human-computer dialogue system and improve user satisfaction.
[0003] Currently, the systems in the industry mainly classify intent based on supervised machine learning models. However, there are the following shortcomings in actual application: when using supervised machine learning models, a large amount of annotated corpus is required for each intent category; when adding new intent categories, additional model training is required before intent recognition processing can be performed, resulting in low convenience in intent classification. Summary of the invention
[0004] The present invention provides a method, device, equipment and storage medium for intent classification based on voting decision, aiming to improve the convenience of intent classification.
[0005] A first aspect of an embodiment of the present invention provides an intention classification method based on voting decision, comprising:
[0006] Extract keywords from the text to be processed to obtain target keywords, wherein the text to be processed is used to indicate the input consulting information;
[0007] Using the target keyword as an index to retrieve preset historical texts, obtaining candidate historical texts corresponding to the target keyword, wherein the historical texts are used to indicate consulting information stored in the database before receiving the text to be processed;
[0008] Calculating the score of the candidate historical text by using a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning;
[0009] The candidate historical texts are sorted and voted according to the scores to obtain a target historical text, and the pre-marked intent category in the target historical text is obtained, and the intent category is used as the target intent category of the text to be processed.
[0010] Optionally, in a first implementation manner of the first aspect of the embodiment of the present invention, the candidate historical texts are sorted and voted according to the scores to obtain a target historical text, a pre-marked intent category in the target historical text is obtained, and the intent category is used as the target intent category of the text to be processed, including:
[0011] The score is used as the weight value of the intent category corresponding to the candidate historical text;
[0012] Sorting the candidate historical texts in descending order according to the weight values to obtain sorted historical texts;
[0013] Obtaining the sorting history text within the preset ranking range to obtain the candidate sorting history text;
[0014] Performing weighted calculation on the candidate sorting historical texts, and taking the candidate sorting historical text with the largest value obtained by the weighted calculation as the target historical text;
[0015] The tag information in the target historical text is obtained, the pre-marked intent category in the tag information is identified, and the intent category is used as the target intent category of the text to be processed.
[0016] Optionally, in a second implementation manner of the first aspect of the embodiment of the present invention, before extracting keywords from the text to be processed to obtain target keywords, the voting decision-based intention classification method further includes:
[0017] Acquire an initial historical text, and perform keyword extraction on the initial historical text to obtain initial keywords;
[0018] A corresponding relationship between the initial keywords and the initial historical text is created through an inverted index algorithm to obtain the historical text.
[0019] Optionally, in a third implementation manner of the first aspect of the embodiment of the present invention, the step of using the target keyword as an index to retrieve a preset historical text to obtain a candidate historical text corresponding to the target keyword includes:
[0020] Using the target keyword as an index, searching the historical text according to the index and the corresponding relationship to obtain a first set;
[0021] Performing semantic matching on the text to be processed and the historical text according to the target keyword to obtain a second set;
[0022] The first set and the second set are combined to obtain candidate historical texts.
[0023] Optionally, in a fourth implementation manner of the first aspect of the embodiment of the present invention, using the target keyword as an index and searching the historical text according to the index and the corresponding relationship to obtain a first set includes:
[0024] Creating an index tree structure according to the initial keywords, the corresponding relationships and the historical texts;
[0025] The target keyword is used as an index, and the index tree structure is traversed according to the index to obtain a first set.
[0026] Optionally, in a fifth implementation of the first aspect of the embodiment of the present invention, calculating the score of the candidate historical text by using a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning includes:
[0027] Calculate the syntactic similarity between the text to be processed and the candidate historical text by using a bilingual evaluation replacement score BLEU algorithm to obtain a word list similarity score;
[0028] Calculating a semantic similarity score between the text to be processed and the candidate historical text by using a preset twin neural network;
[0029] The weighted average of the word list similarity score and the semantic similarity score is calculated according to a preset weight ratio to obtain the score of the candidate historical text.
[0030] Optionally, in a sixth implementation manner of the first aspect of the embodiment of the present invention, calculating the semantic similarity score between the text to be processed and the candidate historical text by presetting a twin neural network includes:
[0031] Semantically encoding the text to be processed and the candidate historical text respectively by presetting a long short-term memory neural network model, and obtaining first encoding information and second encoding information correspondingly;
[0032] A cosine distance value between the first encoding information and the second encoding information is calculated, and the cosine distance value is used as a semantic similarity score between the text to be processed and the candidate historical text.
[0033] The second aspect of the embodiment of the present invention provides an apparatus for classifying intentions based on voting decisions, which has the function of implementing the method for classifying intentions based on voting decisions provided in the first aspect above. The functions can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, and the units can be software and / or hardware.
[0034] The voting decision-based intention classification device comprises:
[0035] An extraction module, used to extract keywords from the text to be processed to obtain target keywords, wherein the text to be processed is used to indicate the input consulting information;
[0036] A retrieval module, used to retrieve preset historical texts using the target keyword as an index to obtain candidate historical texts corresponding to the target keyword, wherein the historical texts are used to indicate consulting information stored in the database before receiving the text to be processed;
[0037] A calculation module, used to calculate the score of the candidate historical text by using a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning;
[0038] A decision module is used to sort and vote on the candidate historical texts according to the scores to obtain a target historical text, obtain the pre-marked intent category in the target historical text, and use the intent category as the target intent category of the text to be processed.
[0039] Optionally, in a first implementation manner of the second aspect of the embodiment of the present invention, the decision module is specifically used to:
[0040] The score is used as the weight value of the intent category corresponding to the candidate historical text;
[0041] Sorting the candidate historical texts in descending order according to the weight values to obtain sorted historical texts;
[0042] Obtaining the sorting history text within the preset ranking range to obtain the candidate sorting history text;
[0043] Performing weighted calculation on the candidate sorting historical texts, and taking the candidate sorting historical text with the largest value obtained by the weighted calculation as the target historical text;
[0044] The tag information in the target historical text is obtained, the pre-marked intent category in the tag information is identified, and the intent category is used as the target intent category of the text to be processed.
[0045] Optionally, in a sixth implementation of the second aspect of the embodiment of the present invention, the voting decision-based intention classification device further includes:
[0046] An acquisition module is used to acquire an initial historical text and extract keywords from the initial historical text to obtain initial keywords;
[0047] The creation module is used to create a corresponding relationship between the initial keywords and the initial historical text through an inverted index algorithm to obtain the historical text.
[0048] Optionally, in a second implementation of the second aspect of the embodiment of the present invention, the retrieval module includes:
[0049] A retrieval unit, configured to use the target keyword as an index, and retrieve the historical text according to the index and the corresponding relationship to obtain a first set;
[0050] A semantic matching unit, configured to perform semantic matching on the text to be processed and the historical text according to the target keyword to obtain a second set;
[0051] A union processing unit is used to perform a union process on the first set and the second set to obtain candidate historical texts.
[0052] Optionally, in a third implementation of the second aspect of the embodiment of the present invention, the retrieval unit is specifically configured to:
[0053] Creating an index tree structure according to the initial keywords, the corresponding relationships and the historical texts;
[0054] The target keyword is used as an index, and the index tree structure is traversed according to the index to obtain a first set.
[0055] Optionally, in a fourth implementation of the second aspect of the embodiment of the present invention, the calculation module includes:
[0056] A first calculation unit is used to calculate the syntactic similarity between the text to be processed and the candidate historical text by using a bilingual evaluation replacement score BLEU algorithm to obtain a word list similarity score;
[0057] A second calculation unit, used for calculating a semantic similarity score between the text to be processed and the candidate historical text by using a preset twin neural network;
[0058] The third calculation unit is used to calculate the weighted average of the word list similarity score and the semantic similarity score according to a preset weight ratio to obtain the score of the candidate historical text.
[0059] Optionally, in a fifth implementation manner of the second aspect of the embodiment of the present invention, the second computing unit is specifically configured to:
[0060] Semantically encoding the text to be processed and the candidate historical text respectively by presetting a long short-term memory neural network model, and obtaining first encoding information and second encoding information correspondingly;
[0061] A cosine distance value between the first encoding information and the second encoding information is calculated, and the cosine distance value is used as a semantic similarity score between the text to be processed and the candidate historical text.
[0062] A third aspect of an embodiment of the present invention provides an intent classification device based on voting decisions, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the intent classification method based on voting decisions described in any one of the above-mentioned embodiments is implemented.
[0063] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute the intention classification method based on voting decision as described in any one of the above-mentioned embodiments.
[0064] Compared with the prior art, in the technical solution provided by the embodiment of the present invention, a target keyword is obtained by extracting keywords from the text to be processed, and the text to be processed is used to indicate the input consulting information; the target keyword is used as an index to retrieve a preset historical text to obtain a candidate historical text corresponding to the target keyword, and the historical text is used to indicate the consulting information stored in the database before receiving the text to be processed; the score of the candidate historical text is calculated by a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning; the candidate historical texts are sorted and voted according to the scores to obtain the target historical text, and the pre-marked intent category in the target historical text is obtained, and the intent category is used as the target intent category of the text to be processed. The embodiment of the present invention uses an inverted index algorithm and keywords to recall historical texts, calculates the scores of the recalled historical texts according to a syntactic similarity algorithm and a template semantic similarity algorithm based on deep learning, and sorts and votes on them to obtain the target intent category of the text to be processed. The intent category classification process can be realized with a small number of labeled samples, and when a new intent category is added, the classification of the new intent category can be realized without model training, thereby improving the convenience of intent classification. Moreover, on the one hand, the similarity calculation process provides unsupervised calculation. On the basis of improving the convenience of intent classification, the model calculated by deep learning template matching has the generalization ability between intent categories to improve the matching accuracy, and it can support unsupervised methods and is applicable to the initial cold start scenario of the project. On the other hand, the intent classification problem can also be converted into semantic representation calculation or other problems, and has strong generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 A schematic diagram of an embodiment of an intention classification method based on voting decision in an embodiment of the present invention;
[0066] Figure 2 Schematic diagram of another embodiment of the intention classification method based on voting decision in an embodiment of the present invention;
[0067] Figure 3Schematic diagram of an embodiment of an intention classification device based on voting decision in an embodiment of the present invention;
[0068] Figure 4 It is a schematic diagram of another embodiment of the device for classifying intentions based on voting decision in an embodiment of the present invention;
[0069] Figure 5 The figure is a schematic diagram of an embodiment of an intention classification device based on voting decision in an embodiment of the present invention. DETAILED DESCRIPTION
[0070] The embodiments of the present invention provide a voting-based intent classification method, apparatus, device, and storage medium for improving the convenience of intent classification.
[0071] In order to enable those skilled in the art to better understand the solutions of the present invention, the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0072] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described here can be implemented in an order other than the content illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules that are clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The division of modules that appear in the present invention is only a logical division. There may be other division methods when implemented in actual applications, such as multiple modules can be combined or integrated in another system, or some features can be ignored or not executed.
[0073] See also Figure 1 , a flowchart of a method for classifying intentions based on voting decisions provided by an embodiment of the present invention, the following is an example of a method for classifying intentions based on voting decisions provided by the present invention, the method is executed by a computer device, the computer device may be a server or a terminal, the present invention does not limit the type of the execution subject, specifically including:
[0074] 101. Perform keyword extraction on the text to be processed to obtain target keywords, and the text to be processed is used to indicate input consulting information.
[0075] The server performs word segmentation on the text to be processed through natural language processing technology, and filters the word segmentation according to the preset word segmentation filtering rules to obtain the target keywords corresponding to the final text to be processed. Among them, after the server receives the input audio and video data, image data or text data, it performs data preprocessing on the audio and video data, image data or text data to obtain the text to be processed; data preprocessing includes data cleaning processing, data integration processing, data transformation processing and data reduction processing. The Chinese word segmentation tool performs word segmentation operations according to the dependency syntax analysis algorithm or the semantic dependency analysis algorithm and the preset word segmentation rules to obtain the word segmentation with the minimum length. The preset word segmentation filtering rules may include filtering the word segmentation through the stop word list and matching the word segmentation with the entity word through the corresponding business field entity dictionary. Obtain the target keywords of the text to be processed to facilitate the subsequent effective retrieval of historical texts.
[0076] Furthermore, the above step 101 may include: performing word segmentation processing on the text to be processed by a preset word segmentation tool to obtain initial word segmentations, and the text to be processed is used to indicate the input consulting information; filtering the initial word segmentations respectively by a preset stop word list to obtain candidate word segmentations; obtaining candidate keywords by respectively calculating the importance values of the candidate word segmentations, and the importance values are the word frequency of the candidate word segmentations in the corresponding business domain corpus-inverse text frequency index IDF value; performing entity word matching processing on the candidate keywords in the business domain dictionary to obtain target keywords.
[0077] For example, if the text to be processed is "Excuse me, I have had a heart disease, can I still buy insurance?", a word segmentation tool (Chinese word segmentation tools can be jieba word segmentation, ansj word segmentation, Harbin Institute of Technology ltp word segmentation or self-developed word segmentation tools) is used to segment the text to be processed, and the initial word segmentation "Excuse me, I have had a heart disease, can I still buy insurance?" is obtained by filtering with a preset stop word list (the stop word list is generally a public Chinese stop word list, including modal particles, meaningless words, punctuation marks and other words that have no practical meaning) to obtain candidate words. The word segmentation "once / had / heart disease / undergo / insured" is matched with the corresponding business domain corpus - life insurance domain corpus and business domain dictionary - life insurance domain dictionary, and the IDF value (i.e., importance value) of the candidate word segmentation in the life insurance domain corpus is calculated. The candidate word segmentation is filtered according to the importance value, and it can be determined that "heart disease / insured" is an important word. The candidate keywords are obtained, and the candidate keywords are matched with entity words using the life insurance domain dictionary. "Heart disease" is an entity word. Finally, the union of "heart disease / insured" and "heart disease" "heart disease / insured" is taken as the final target keyword.
[0078] 102. Using the target keyword as an index to retrieve preset historical texts, obtain candidate historical texts corresponding to the target keyword, where the historical texts are used to indicate consulting information stored in the database before receiving the text to be processed.
[0079] The server uses the target keyword as an index, matches and recalls historical files based on the index and the mapping relationship between the keywords in the historical text and the historical text, thereby obtaining candidate historical texts. By recalling historical texts based on target keywords, it is possible to eliminate the need for a large amount of annotated corpus for each intent category, and when adding new intent categories, no additional training is required for the newly added intent categories. Instead, the index of the newly added intent category can be written into the index library through recall, and it can be put online without model training, which improves the convenience and efficiency of operation.
[0080] Furthermore, the above step 102 may include: using the target keyword as an index, retrieving historical texts according to the index and the corresponding relationship, and obtaining a first set; performing semantic matching on the text to be processed and the historical text according to the target keyword, and obtaining a second set; and performing a union processing on the first set and the second set to obtain candidate historical texts.
[0081] The server matches the historical texts according to the glyph composition and correspondence of the target keyword through the preset search engine Elastic Search, and realizes the shallow literal matching recall of the target keyword. And through the word vector information of the target keyword and the word vector information, the initial keyword similar to the target keyword is retrieved in the index, and the historical text corresponding to the initial keyword is obtained for supplementary recall, semantic matching is realized, and the recall rate and accuracy rate are improved. Among them, the server obtains the first word vector of the first keyword and the second word vector of the second keyword respectively through the Word2vec model; the server calculates the similarity of the first word vector and the second word vector to obtain the similarity value; the server takes the historical text with a similarity value greater than or equal to the first preset threshold as the second set. For example: the target keyword is "a million free lines / compensation / examples", and the search engine Elastic Search is used to perform a direct index search based on "a million free lines" to obtain the first set, obtain the word vectors of "compensation" and "examples", and the word vector of the initial keyword, and the second set is obtained by calculating the word vector similarity.
[0082] Furthermore, the above-mentioned target keyword is used as an index, and the historical text is retrieved according to the index and the corresponding relationship to obtain a first set, which specifically includes: creating an index tree structure according to the initial keyword, the corresponding relationship and the historical text; using the target keyword as an index, traversing the index tree structure according to the index to obtain the first set.
[0083] The server creates an index tree structure based on the initial keywords, corresponding relationships and historical texts through a preset search engine tool to facilitate fast and efficient retrieval. The index tree structure can be a binary tree or a B+ tree. The index can be a unique index to prevent the addition of new data that will create duplicate key values in the index table; the index can also be an index column to facilitate efficient retrieval of multiple data or multiple columns of data in the index tree structure at the same time; the index can also be a clustered index to quickly access the index tree structure and perform multi-path retrieval.
[0084] 103. The scores of candidate historical texts are calculated using the template semantic similarity algorithm and syntactic similarity algorithm based on deep learning.
[0085] The server uses the template semantic similarity and syntactic similarity calculation algorithms based on deep learning to comprehensively score the candidate historical texts and obtain the scores of the candidate historical texts. Among them, the syntactic similarity algorithm mainly uses the sentence surface word similarity information between the text to be processed and the candidate historical text to measure the word table similarity between the two, and then obtain the score of the candidate historical text. The template semantic similarity algorithm based on deep learning uses a twin neural network to calculate the semantic representation similarity between the text to be processed and the candidate historical text, and based on this, it determines whether the text to be processed and the candidate historical text are the same or similar, and then obtains the score of the candidate historical text. By using the template semantic similarity algorithm and syntactic similarity algorithm based on deep learning to calculate the score, the matching accuracy is improved, and the intent classification problem can be converted into a similarity matching problem, enhancing the generalization ability between intent categories.
[0086] Furthermore, the above step 103 may include: calculating the syntactic similarity between the text to be processed and the candidate historical text through the bilingual evaluation replacement score BLEU algorithm to obtain a word list similarity score; calculating the semantic similarity score between the text to be processed and the candidate historical text through a preset twin neural network; calculating the weighted average of the word list similarity score and the semantic similarity score according to a preset weight ratio to obtain the score of the candidate historical text.
[0087] Among them, the server calculates the syntactic similarity between the text to be processed and the candidate historical text through the bilingual evaluation replacement score BLEU algorithm to obtain the word list similarity score. For example: the text to be processed "What to do if self-verification fails" and the candidate historical text "What to do if self-verification fails", when only considering one-gram, bi-gram, and tri-gram, the BLEU values of "What to do if self-verification fails" and "Self-verification operation steps" are higher than the BLEU values of "What to do if self-verification fails" and "Self-verification operation steps". The syntactic similarity between the text to be processed and the candidate historical text is calculated to be 0.642 through the bilingual evaluation replacement score BLEU algorithm, and then a word list similarity score of 6.42 is obtained, without the need for a model or prior training. The semantic similarity between the text to be processed and the candidate historical texts is calculated by a preset twin neural network. The value of the semantic similarity can be used as the semantic similarity score between the text to be processed and the candidate historical text. The value of the semantic similarity can also be compared with a preset semantic similarity score table. The score corresponding to the semantic similarity range value in the semantic similarity score table is used as the semantic similarity score value. The semantic similarity score value is an indicator range value set by expert rules or experimental verification.
[0088] Furthermore, the above-mentioned calculation of the semantic similarity score between the text to be processed and the candidate historical texts by presetting the twin neural network may include: the server semantically encodes the text to be processed and the candidate historical text respectively by presetting the long short-term memory neural network model, and obtains the first encoding information and the second encoding information accordingly; the server calculates the cosine distance value between the first encoding information and the second encoding information, and uses the cosine distance value as the semantic similarity score between the text to be processed and the candidate historical text.
[0089] The bottom layer of the preset twin neural network can model the input sentence (text to be processed or candidate historical text) through the preset long short-term memory neural network model of LSTM or CNN. The two inputs (text to be processed and candidate historical text) are respectively represented by two sentences through the same sentence encoder. The top layer uses cosine distance to calculate the semantic similarity between the text to be processed and the candidate historical text, thereby obtaining a semantic similarity score. For example, in the twin neural network based on LSTM encoder trained with life insurance question-answering data, the cosine distance value of "what to do if the self-verification fails" and "what to do if the self-verification fails" in the twin neural network is 0.934, and the semantic similarity score is 0.934 points. The semantic similarity of "what to do if the self-verification fails" and "what to do with the self-verification procedures" in the twin neural network is 0.634, and the cosine distance value is 0.634 points. The cosine distance value of "what to do if the self-verification fails" and "self-verification operation steps" in the model is 0.1183, and the semantic similarity score is 0.1183 points.
[0090] 104. Sort and vote the candidate historical texts according to the scores to obtain the target historical text, obtain the pre-marked intent category in the target historical text, and use the intent category as the target intent category of the text to be processed.
[0091] The server makes voting decisions on the candidate texts based on the preset rules of treating the candidate texts equally based on importance or the preset rules of ranking by scores. In the preset rules of ranking by scores, it is determined whether the score is greater than or equal to the second preset threshold; if the score is greater than or equal to the second preset threshold, the corresponding candidate historical text is used as the historical text to be voted, and the score of the candidate historical text is used as the weight value of the intention category corresponding to the candidate historical text; the historical text to be voted is processed by cumulative weighted voting to obtain the voting historical text; the voting historical text with the largest number of votes is used as the target historical text, and the intention category corresponding to the target historical text is used as the target intention category of the text to be processed. For example, in the score calculation, the thresholds of the word list similarity score and the semantic similarity score can be set to 0.5. Any candidate historical text with a score less than 0.5 will not participate in the subsequent sorting process. For the results of "What to do if self-verification fails - What to do if self-verification fails / Category A, 0.934", "What to do if self-verification fails - What to do if self-verification fails / Category A, 0.869", "What to do if self-verification fails - What to do with self-verification procedures / Category B, 0.634", "What to do if self-verification fails / self-verification operation steps / Category C, 0.1183", "Self-verification operation steps" can be filtered out. The remaining historical texts to be voted for get two votes for Category A and one vote for Category B, so that the intent category of "What to do if self-verification fails" is used as the target intent category of the text to be processed.
[0092] Furthermore, the above step 104 may include: using the score as the weight value of the intent category corresponding to the candidate historical text; sorting the candidate historical texts in descending order according to the weight value to obtain a sorted historical text; obtaining the sorted historical texts within a preset ranking range to obtain a candidate sorted historical text; performing weighted calculation on the candidate sorted historical texts, and using the candidate sorted historical text with the largest value obtained by the weighted calculation as the target historical text; obtaining label information in the target historical text, identifying the pre-marked intent category in the label information, and using the intent category as the target intent category of the text to be processed.
[0093] The server uses the score as the weight value of the candidate historical text intent category, sorts the candidate historical texts according to the weight value from large to small, obtains the sorted historical text, performs weighted calculation on the sorted historical text in the preset sorting, obtains the label information in the sorted candidate historical text (i.e., the target historical text) with the largest weighted calculation value, identifies the pre-marked intent category in the label information, and uses the intent category as the target intent category of the text to be processed, wherein the server pre-identifies the intent of the historical text through the intent recognition model to obtain the intent category, and marks the intent category corresponding to the historical text in the label information. For example: the weighted evaluation of the top two ranked historical texts is: the weighted calculation value of the sorted historical text A is 1*0.934+1*0.869=1.803, and the weighted calculation value of the sorted historical text B is 1*0.634=0.634. Since 1.803 is greater than 0.634, the intent category of the sorted historical text A is the target intent category of the text to be processed.
[0094] In an embodiment of the present invention, an inverted index algorithm and keywords are used to recall historical texts, and scores of the recalled historical texts are calculated according to a syntactic similarity algorithm and a template semantic similarity algorithm based on deep learning, and the scores are sorted and voted on to obtain the target intent category of the text to be processed. The intent category classification process can be realized with a small number of labeled samples, and when a new intent category is added, the classification of the new intent category can be realized without model training, thereby improving the convenience of intent classification. Moreover, on the one hand, the similarity calculation process provides unsupervised calculations. On the basis of improving the convenience of intent classification, not only can the model calculated by deep learning template matching have the generalization ability between intent categories to improve the matching accuracy, but it can also be applicable to the initial cold start scenario of the project. On the other hand, the intent classification problem can be converted into semantic representation calculation or other problems, and has strong generalization ability.
[0095] See also Figure 2 Another embodiment of the intention classification method based on voting decision in the embodiment of the present invention includes:
[0096] 201. Obtain an initial historical text, and perform keyword extraction on the initial historical text to obtain initial keywords.
[0097] The server obtains the initial historical text stored in the database, which is the consulting information input by the user or crawled from various platforms, for example, "What is the audit process?" input by the user. After the server obtains the initial historical text, it can extract keywords from the initial historical text by using the method of extracting keywords from the text to be processed to obtain target keywords, and obtain the initial keywords. Please refer to the method in 101 above, which will not be repeated here.
[0098] 202. Create a correspondence between the initial keywords and the initial historical text through an inverted index algorithm to obtain the historical text.
[0099] The server creates a correspondence between the initial keyword and the initial historical text corresponding to the initial keyword through the combination of the word dictionary and the inverted file in the inverted index algorithm, wherein each index item in the word dictionary records the initial keyword and some information of the initial keyword itself as well as a pointer to the "inverted list", and the inverted file stores the physical file of the inverted index. For example: the initial keyword is "Million Renwo Bank, claims and cases", and the initial historical text corresponding to the initial keyword is "I want to see the claims cases of Million Renwo Bank", then the index of the initial keyword and the initial historical text corresponding to the initial keyword is created through the inverted index algorithm: "Million Renwo Bank" - "I want to see the claims cases of Million Renwo Bank", "Claims" - "I want to see the claims cases of Million Renwo Bank", "Case" - "I want to see the claims cases of Million Renwo Bank", and the historical text is obtained.
[0100] 203. Perform keyword extraction on the text to be processed to obtain target keywords, and the text to be processed is used to indicate input consulting information.
[0101] 204. Using the target keyword as an index to retrieve preset historical texts, obtain candidate historical texts corresponding to the target keyword, where the historical texts are used to indicate consulting information stored in the database before receiving the text to be processed.
[0102] 205. The scores of candidate historical texts are calculated using a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning.
[0103] 206. Sort and vote the candidate historical texts according to the scores to obtain the target historical text, obtain the pre-marked intent category in the target historical text, and use the intent category as the target intent category of the text to be processed.
[0104] In the embodiment of the present invention, the methods from 203 to 206 may refer to 101 to 104 and will not be described in detail here.
[0105] In an embodiment of the present invention, a correspondence between initial keywords and initial historical texts is created through an inverted index algorithm to obtain historical texts. On the basis of improving the convenience of intent classification, it is not only conducive to quickly and effectively recalling historical texts based on keywords of the text to be processed, and has strong generalization capabilities and improves matching accuracy, but also can directly use keywords corresponding to the newly added intent categories to recall and classify the newly added intent categories when adding new intent categories, and classification of the newly added intent categories can be achieved without model training.
[0106] The above describes the intention classification method based on voting decision in the embodiment of the present invention. The following describes the intention classification device based on voting decision in the embodiment of the present invention. Figure 3 , an embodiment of the device for classifying intentions based on voting decision in an embodiment of the present invention includes:
[0107] Extraction module 301, used to extract keywords from the text to be processed to obtain target keywords, where the text to be processed is used to indicate the input consulting information;
[0108] Retrieval module 302, used to retrieve preset historical texts using the target keyword as an index to obtain candidate historical texts corresponding to the target keyword, the historical texts being used to indicate consulting information stored in the database before receiving the text to be processed;
[0109] A calculation module 303, used to calculate the scores of candidate historical texts by using a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning;
[0110] The decision module 304 is used to sort and vote on the candidate historical texts according to the scores, obtain the target historical text, obtain the pre-marked intention category in the target historical text, and use the intention category as the target intention category of the text to be processed.
[0111] The functional implementation of each module in the above-mentioned intention classification device based on voting decision corresponds to the various steps in the above-mentioned intention classification method embodiment based on voting decision, and its functions and implementation processes will not be repeated here one by one.
[0112] In an embodiment of the present invention, an inverted index algorithm and keywords are used to recall historical texts, and scores of the recalled historical texts are calculated according to a syntactic similarity algorithm and a template semantic similarity algorithm based on deep learning, and the scores are sorted and voted on to obtain the target intent category of the text to be processed. The intent category classification process can be realized with a small number of labeled samples, and when a new intent category is added, the classification of the new intent category can be realized without model training, thereby improving the convenience of intent classification. Moreover, on the one hand, the similarity calculation process provides unsupervised calculations. On the basis of improving the convenience of intent classification, not only can the model calculated by deep learning template matching have the generalization ability between intent categories to improve the matching accuracy, but it can also be applicable to the initial cold start scenario of the project. On the other hand, the intent classification problem can be converted into semantic representation calculation or other problems, and has strong generalization ability.
[0113] See also Figure 4 Another embodiment of the device for classifying intentions based on voting decision in the embodiment of the present invention includes:
[0114] The acquisition module 401 is used to acquire the initial historical text and extract keywords from the initial historical text to obtain initial keywords;
[0115] A creation module 402 is used to create a correspondence between the initial keywords and the initial historical texts through an inverted index algorithm to obtain the historical texts;
[0116] Extraction module 403, used to extract keywords from the text to be processed to obtain target keywords, where the text to be processed is used to indicate the input consulting information;
[0117] Retrieval module 404, used to retrieve preset historical texts using the target keyword as an index to obtain candidate historical texts corresponding to the target keyword, the historical texts being used to indicate consulting information stored in the database before receiving the text to be processed;
[0118] A calculation module 405 is used to calculate the scores of the candidate historical texts by using a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning;
[0119] The decision module 406 is used to sort and vote on the candidate historical texts according to the scores, obtain the target historical text, obtain the pre-marked intention category in the target historical text, and use the intention category as the target intention category of the text to be processed.
[0120] Optionally, the retrieval module 404 includes: a retrieval unit, used to use the target keyword as an index, retrieve the historical text according to the index and the corresponding relationship, and obtain a first set; a semantic matching unit, used to perform semantic matching on the processed text and the historical text according to the target keyword, and obtain a second set; a union processing unit, used to perform union processing on the first set and the second set, and obtain candidate historical texts.
[0121] Optionally, the retrieval unit is specifically used to: create an index tree structure according to initial keywords, corresponding relationships and historical texts; use the target keyword as an index, traverse the index tree structure according to the index, and obtain a first set.
[0122] Optionally, the calculation module 405 includes: a first calculation unit, used to calculate the syntactic similarity between the text to be processed and the candidate historical text through the bilingual evaluation replacement score BLEU algorithm, and obtain the word list similarity score; a second calculation unit, used to calculate the semantic similarity score between the text to be processed and the candidate historical text through a preset twin neural network; a third calculation unit, used to calculate the weighted average of the word list similarity score and the semantic similarity score according to a preset weight ratio, and obtain the score of the candidate historical text.
[0123] Optionally, the second computing unit is specifically used to: perform semantic encoding on the text to be processed and the candidate historical text respectively through a preset long short-term memory neural network model, and obtain first encoding information and second encoding information correspondingly; calculate the cosine distance value between the first encoding information and the second encoding information, and use the cosine distance value as the semantic similarity score between the text to be processed and the candidate historical text.
[0124] Optionally, the decision module 406 is specifically used to: use the score as the weight value of the intent category corresponding to the candidate historical text; sort the candidate historical texts in descending order according to the weight value to obtain a sorted historical text; obtain the sorted historical text within a preset ranking range to obtain a candidate sorted historical text; perform weighted calculation on the candidate sorted historical texts, and use the candidate sorted historical text with the largest value obtained by the weighted calculation as the target historical text; obtain the label information in the target historical text, identify the pre-marked intent category in the label information, and use the intent category as the target intent category of the text to be processed.
[0125] The functional implementation of each module and each unit in the above-mentioned intention classification device based on voting decision corresponds to the steps in the above-mentioned intention classification method embodiment based on voting decision, and their functions and implementation processes will not be repeated here one by one.
[0126] In an embodiment of the present invention, a correspondence between initial keywords and initial historical texts is created through an inverted index algorithm to obtain historical texts. On the basis of improving the convenience of intent classification, it is not only conducive to quickly and effectively recalling historical texts based on keywords of the text to be processed, and has strong generalization capabilities and improves matching accuracy, but also can directly use keywords corresponding to the newly added intent categories to recall and classify the newly added intent categories when adding new intent categories, and classification of the newly added intent categories can be achieved without model training.
[0127] above Figure 3 to Figure 4 The intention classification device based on voting decision in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the intention classification device based on voting decision in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0128] Figure 5: is a structural diagram of an intention classification device based on voting decision provided by an embodiment of the present invention. The intention classification device 500 based on voting decision may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 501 (for example, one or more processors) and a memory 509, and one or more storage media 508 (for example, one or more massive storage devices) storing application programs 507 or data 506. Among them, the memory 509 and the storage medium 508 can be short-term storage or permanent storage. The program stored in the storage medium 508 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the sign-in management device. Furthermore, the processor 501 can be configured to communicate with the storage medium 508 to execute a series of instruction operations in the storage medium 508 on the intention classification device 500 based on voting decision.
[0129] The voting-based intention classification device 500 may also include one or more power supplies 502, one or more wired or wireless network interfaces 503, one or more input and output interfaces 504, and / or one or more operating systems 505, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that Figure 5 The structure of the device for classifying intent based on voting decision shown in the figure does not constitute a limitation on the device for classifying intent based on voting decision, and may include more or less components than shown in the figure, or combine certain components, or arrange components differently. The processor 501 may execute the functions of the acquisition module 301, the creation module 302, the extraction module 303, the retrieval module 304, the calculation module 305, the decision module 306, the acquisition module 401, the creation module 402, the extraction module 403, the retrieval module 404, the calculation module 405, and the decision module 406 in the above-mentioned embodiments.
[0130] Combine the following Figure 5 The following is a detailed introduction to the various components of the voting-based intent classification device:
[0131] Processor 501 is the control center of the intent classification device based on voting decision, and can process according to the intent classification method based on voting decision. Processor 501 uses various interfaces and lines to connect various parts of the entire intent classification device based on voting decision, and executes various functions and processes data of the intent classification device based on voting decision by running or executing software programs and / or modules stored in memory 509, and calling data stored in memory 509, thereby realizing the function of improving the convenience of intent classification. Storage medium 508 and memory 509 are both carriers for storing data. In the embodiment of the present invention, storage medium 508 can refer to an internal memory with a small storage capacity but a fast speed, and memory 509 can be an external memory with a large storage capacity but a slow storage speed.
[0132] The memory 509 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing of the intention classification device 500 based on voting decision by running the software programs and modules stored in the memory 509. The memory 509 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (keyword extraction of the text to be processed, obtaining the target keyword, etc.), etc.; the data storage area can store data created according to the use of the sign-in management device (using the target keyword as an index to retrieve the preset historical text, obtaining the candidate historical text corresponding to the target keyword, etc.), etc. In addition, the memory 509 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. The intention classification method program based on voting decision provided in the embodiment of the present invention and the received data stream are stored in the memory, and when needed, the processor 501 calls from the memory 509.
[0133] When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, twisted pair) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., an optical disk), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0134] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0135] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0136] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, each functional unit in the embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0138] 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 computer-readable storage medium. Based on this understanding, the technical solution of the present invention 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. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0139] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A voting decision-based intention classification method, characterized in that: include: Extract keywords from the text to be processed to obtain target keywords, wherein the text to be processed is used to indicate the input consulting information; Using the target keyword as an index to retrieve preset historical texts, obtaining candidate historical texts corresponding to the target keyword, wherein the historical texts are used to indicate consulting information stored in the database before receiving the text to be processed; Calculating the score of the candidate historical text by using a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning; Sort and vote the candidate historical texts according to the scores to obtain a target historical text, obtain the pre-marked intent category in the target historical text, and use the intent category as the target intent category of the text to be processed; The step of sorting and voting the candidate historical texts according to the scores to obtain a target historical text, obtaining a pre-marked intent category in the target historical text, and using the intent category as a target intent category of the text to be processed includes: The score is used as the weight value of the intent category corresponding to the candidate historical text; Sorting the candidate historical texts in descending order according to the weight values to obtain sorted historical texts; Obtaining the sorting history text within the preset ranking range to obtain the candidate sorting history text; Performing weighted calculation on the candidate sorting historical texts, and taking the candidate sorting historical text with the largest value obtained by the weighted calculation as the target historical text; Acquire tag information in the target historical text, identify the pre-marked intent category in the tag information, and use the intent category as the target intent category of the text to be processed; The calculating the score of the candidate historical text by using the template semantic similarity algorithm and the syntactic similarity algorithm based on deep learning includes: Calculate the syntactic similarity between the text to be processed and the candidate historical text by using a bilingual evaluation replacement score BLEU algorithm to obtain a word list similarity score; Calculating a semantic similarity score between the text to be processed and the candidate historical text by using a preset twin neural network; The weighted average of the word list similarity score and the semantic similarity score is calculated according to a preset weight ratio to obtain the score of the candidate historical text.
2. The intention classification method based on voting decision according to claim 1 is characterized in that: Before extracting keywords from the text to be processed to obtain target keywords, the voting-based intention classification method further includes: Acquire an initial historical text, and perform keyword extraction on the initial historical text to obtain initial keywords; A corresponding relationship between the initial keywords and the initial historical text is created through an inverted index algorithm to obtain the historical text.
3. The intention classification method based on voting decision according to claim 2 is characterized in that: The step of using the target keyword as an index to retrieve preset historical texts to obtain candidate historical texts corresponding to the target keyword includes: Using the target keyword as an index, searching the historical text according to the index and the corresponding relationship to obtain a first set; Performing semantic matching on the text to be processed and the historical text according to the target keyword to obtain a second set; The first set and the second set are combined to obtain candidate historical texts.
4. The intention classification method based on voting decision according to claim 3 is characterized in that: The step of using the target keyword as an index and searching the historical text according to the index and the corresponding relationship to obtain a first set includes: Creating an index tree structure according to the initial keywords, the corresponding relationships and the historical texts; The target keyword is used as an index, and the index tree structure is traversed according to the index to obtain a first set.
5. The voting decision-based intention classification method according to claim 1 is characterized in that: The calculating the semantic similarity score between the text to be processed and the candidate historical text by presetting the twin neural network includes: Semantically encoding the text to be processed and the candidate historical text respectively by presetting a long short-term memory neural network model, and obtaining first encoding information and second encoding information correspondingly; A cosine distance value between the first encoding information and the second encoding information is calculated, and the cosine distance value is used as a semantic similarity score between the text to be processed and the candidate historical text.
6. An intention classification device based on voting decision, characterized in that: The device comprises: An extraction module, used to extract keywords from the text to be processed to obtain target keywords, wherein the text to be processed is used to indicate the input consulting information; A retrieval module, used to retrieve preset historical texts using the target keyword as an index to obtain candidate historical texts corresponding to the target keyword, wherein the historical texts are used to indicate consulting information stored in the database before receiving the text to be processed; A calculation module, used to calculate the score of the candidate historical text by using a template semantic similarity algorithm and a syntactic similarity algorithm based on deep learning; A decision module, used to sort and vote on the candidate historical texts according to the scores to obtain a target historical text, obtain the pre-marked intent category in the target historical text, and use the intent category as the target intent category of the text to be processed; The decision module is specifically used for: The score is used as the weight value of the intent category corresponding to the candidate historical text; Sorting the candidate historical texts in descending order according to the weight values to obtain sorted historical texts; Obtaining the sorting history text within the preset ranking range to obtain the candidate sorting history text; Performing weighted calculation on the candidate sorting historical texts, and taking the candidate sorting historical text with the largest value obtained by the weighted calculation as the target historical text; Acquire tag information in the target historical text, identify the pre-marked intent category in the tag information, and use the intent category as the target intent category of the text to be processed; The calculation module comprises: A first calculation unit is used to calculate the syntactic similarity between the text to be processed and the candidate historical text by using a bilingual evaluation replacement score BLEU algorithm to obtain a word list similarity score; A second calculation unit, used for calculating a semantic similarity score between the text to be processed and the candidate historical text by using a preset twin neural network; The third calculation unit is used to calculate the weighted average of the word list similarity score and the semantic similarity score according to a preset weight ratio to obtain the score of the candidate historical text.
7. The voting decision-based intention classification device according to claim 6, characterized in that: The voting decision-based intention classification device further includes: An acquisition module is used to acquire an initial historical text and extract keywords from the initial historical text to obtain initial keywords; The creation module is used to create a corresponding relationship between the initial keywords and the initial historical text through an inverted index algorithm to obtain the historical text.
8. The voting decision-based intention classification device according to claim 7, characterized in that: The retrieval module comprises: A retrieval unit, configured to use the target keyword as an index, and retrieve the historical text according to the index and the corresponding relationship to obtain a first set; A semantic matching unit, configured to perform semantic matching on the text to be processed and the historical text according to the target keyword to obtain a second set; A union processing unit is used to perform a union process on the first set and the second set to obtain candidate historical texts.
9. An intention classification device based on voting decision, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the intention classification method based on voting decision as described in any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on a computer, enable the computer to execute the intention classification method based on voting decision as described in any one of claims 1 to 5.
Citation Information
Patent Citations
A method and device for processing information
CN110019742A
Prediction method, system and device for scene category of session text and storage medium
CN110413788A