Disclosure of Invention
The embodiment of the invention aims to provide a user intention recognition method aiming at feedback content so as to improve the efficiency of determining the feedback intention of a user based on the feedback content of the user. The specific technical scheme is as follows:
In a first aspect, an embodiment of the present invention provides a method for identifying user intention with respect to feedback content, including:
Acquiring target feedback content to be identified;
Determining an intention category corresponding to the classification condition met by the target feedback content as an initial category based on a preset corresponding relation between each classification condition and the intention category, wherein the intention category corresponding to each classification condition is an intention category which can be represented by the feedback content meeting the classification condition;
If the initial category is judged to be the appointed category, determining an intention recognition result of the target feedback content by utilizing a pre-trained intention classification model;
otherwise, determining the initial category as an intention recognition result of the target feedback content;
the intention classification model is a classification model trained based on a plurality of sample feedback contents, wherein the sample feedback contents can represent the sample feedback contents of the specified category and the sample feedback contents can represent the similar intention category of the specified category.
Optionally, before determining, as the initial category, an intention category corresponding to the classification condition satisfied by the target feedback content based on a preset correspondence relation between each classification condition and the intention category, the method further includes:
generating sentence vectors representing the target feedback content as target vectors;
Calculating the distance between the target vector and each type of cluster in a clustering space, wherein the clustering space is established based on sentence vectors of sample feedback content, and each type of cluster in the clustering space is associated with an intention type;
determining a target class cluster with a distance from the target vector smaller than a preset threshold value, and determining an intention class associated with the target class cluster as a preselected class;
the determining, based on a preset correspondence relation between each classification condition and an intention category, the intention category corresponding to the classification condition satisfied by the target feedback content as an initial category includes:
and determining an intention category corresponding to the classification condition met by the target feedback content as an initial category based on the preset corresponding relation between each classification condition and the intention category and the pre-selected category.
Optionally, the determining, based on the preset correspondence between each classification condition and the intent category and the pre-selected category, the intent category corresponding to the classification condition satisfied by the target feedback content, as the initial category includes:
Searching classification conditions corresponding to the preselected categories from preset corresponding relations of the classification conditions and the intention categories;
And determining the classification condition met by the target feedback content from the searched classification conditions, and determining the intention category corresponding to the classification condition met by the target feedback content based on the corresponding relation as an initial category.
Optionally, the generating a sentence vector representing the target feedback content includes:
Determining key word segmentation contained in the target feedback content, wherein the key word segmentation is a word segmentation belonging to a preset word segmentation type;
Generating word vectors of the key word segments, and generating sentence vectors representing the target feedback content based on the word vectors of the key word segments.
Optionally, the intention classification model is an intention classification model trained based on a random forest classification model.
Optionally, the method further comprises:
and determining the sub-category with the mapping relation with the preset segmentation included in the target feedback content as the sub-category of the target feedback content according to the preset mapping relation between the preset segmentation and the sub-category under the intention recognition result.
In a second aspect, an embodiment of the present invention provides a user intention recognition apparatus for feedback content, including:
The content acquisition module is used for acquiring target feedback content to be identified;
the system comprises a category determining module, a target feedback content determining module and a feedback content determining module, wherein the category determining module is used for determining an intention category corresponding to a classification condition met by the target feedback content as an initial category based on a preset corresponding relation between each classification condition and the intention category, wherein the intention category corresponding to each classification condition is an intention category which can be represented by the feedback content meeting the classification condition;
The result determining module is used for determining the intention recognition result of the target feedback content by utilizing a pre-trained intention classification model if the initial category is judged to be the designated category, otherwise, determining the initial category as the intention recognition result of the target feedback content;
the intention classification model is a classification model trained based on a plurality of sample feedback contents, wherein the sample feedback contents can represent the sample feedback contents of the specified category and the sample feedback contents can represent the similar intention category of the specified category.
Optionally, the apparatus further includes:
A vector generation module, configured to, before the category determination module performs determining, based on a preset correspondence relation between each classification condition and an intention category, an intention category corresponding to a classification condition satisfied by the target feedback content, as an initial category, generate, as a target vector, a sentence vector representing the target feedback content;
The distance calculation module is used for calculating the distance between the target vector and each type of cluster in a clustering space, wherein the clustering space is established based on sentence vectors of sample feedback content, and each type of cluster in the clustering space is associated with an intention type;
The class cluster determining module is used for determining a target class cluster with the distance between the target cluster and the target vector being smaller than a preset threshold value, and determining an intention class associated with the target class cluster as a preselected class;
The category determining module is specifically configured to determine, as an initial category, an intention category corresponding to a classification condition satisfied by the target feedback content based on a preset correspondence between each classification condition and the intention category and the pre-selected category.
Optionally, the category determining module is specifically configured to search for a classification condition corresponding to the pre-selected category from preset correspondence between each classification condition and an intention category, determine a classification condition satisfied by the target feedback content from the searched classification conditions, and determine, based on the correspondence, the intention category corresponding to the classification condition satisfied by the target feedback content as the initial category.
Optionally, the vector generation module is specifically configured to determine a keyword that is included in the target feedback content, where the keyword is a word that belongs to a preset word type, generate a word vector of the keyword, and generate, based on the word vector of the keyword, a sentence vector that represents the target feedback content.
Optionally, the intention classification model is an intention classification model trained based on a random forest classification model.
Optionally, the apparatus further includes:
The subcategory determining module is used for determining the subcategory which has a mapping relation with the preset word included in the target feedback content as the subcategory of the target feedback content according to the preset mapping relation between the preset word and the subcategory under the intention recognition result.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
A processor for implementing the method steps provided in the first aspect when executing a program stored on a memory.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the method steps provided by the first aspect.
In the user intention recognition method for the feedback content provided by the embodiment of the invention, because the corresponding relation between each classification condition and the intention category is established in advance, the intention category corresponding to the classification condition met by the target feedback content can be determined, and further, when the initial category is the designated category, the intention recognition result of the target feedback content is determined by using the intention classification model, and otherwise, the initial category is determined as the intention recognition result of the target feedback content. Therefore, the scheme can avoid manually determining the feedback intention of the user based on the feedback content of the user, and realize automatic recognition of the user intention of the target feedback content, so that the recognition efficiency can be improved.
In addition, the method adopts the mode of combining the corresponding relation between each classification condition and the intention category and the intention classification model, so that when the initial category obtained through the corresponding relation has similar categories, the initial category is corrected, and therefore, the accuracy of the intention recognition can be further ensured. Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to improve efficiency of determining feedback intention of a user based on feedback content of the user, the embodiment of the invention provides a user intention identification method and device for feedback content and electronic equipment.
The user intention recognition method for the feedback content is applied to the electronic equipment. In a specific application, the electronic device may be a server, or may be a terminal device such as a smart phone, a tablet computer, or the like.
In one embodiment of the present invention, there is provided a user intention recognition method for feedback content, as shown in fig. 1, the method including the steps of:
s101, acquiring target feedback content to be identified.
In this step, the electronic device may receive feedback content, that is, feedback text, that is, feedback content that is fed back by the user for the product, and use the received feedback content as the target feedback content. Of course, the electronic device may also acquire the target feedback content from the opinion feedback center. The opinion feedback center is a data center for collecting and storing feedback contents such as comments, suggestions and questions of a user aiming at a product, so that the electronic equipment can read the feedback contents from a database used for storing the feedback contents of the user aiming at the product in the opinion feedback center and take the read feedback contents as target feedback contents.
The target feedback content can be comments, opinions, questions and the like of the user aiming at the product. For example, for cleaning tool class applications, the target feedback content may be "how to clean up application garbage", "how to misdelete a file", etc.
The target feedback content may be feedback content obtained by preprocessing the received and obtained feedback content, where the preprocessing is used to remove special characters, such as expressions, symbols, nonsensical repeated characters, and the like, contained in the feedback content.
S102, determining an intention category corresponding to the classification condition met by the target feedback content as an initial category based on a preset corresponding relation between each classification condition and the intention category, wherein the intention category corresponding to each classification condition is an intention category which can be represented by the feedback content meeting the classification condition.
The intention category may be preset based on the function points of the product. For example, illustrated with chat software, opinion categories may include chat categories, address book categories, group chat categories, and the like. Of course, the intent category may also be determined based on the collected sample feedback content.
In order to automatically identify the intention category, a large amount of feedback contents can be collected in advance, and the corresponding relation between each classification condition and the intention category is established by utilizing the intention category characterized by the feedback contents and the text information of the feedback contents, wherein the intention category corresponding to each classification condition is the intention category which can be characterized by the feedback contents meeting the classification condition. Based on the correspondence, when the user intention of the target feedback content needs to be identified, it may be determined that, among the preset classification conditions, the classification condition satisfied by the target feedback content is satisfied, and then the intention category corresponding to the classification condition satisfied by the target feedback content is determined as the initial category. The classification condition corresponding to each intent category may be set based on keywords related to feedback content that may characterize the intent category, such as words that may be included in the feedback content that may characterize the intent category. At this time, the correspondence relation between each classification condition and the intention category may be referred to as a keyword graph, and the corresponding intention category may be determined by the classification condition of the keyword in the keyword graph.
For example, the intent category includes an interface display category and a document processing category, and when "icon", "font", "background" vocabulary appears in the feedback content, the feedback content is highly probable to be the interface display category. Accordingly, the classification condition corresponding to the interface display category is set with "icon", "font", "background" as a keyword. For example, the classification condition corresponding to the interface display category may be that the feedback content includes "background", and then when the target feedback content includes "background", it is determined that the target feedback content belongs to the interface display category.
In addition, the setting of the classification condition corresponding to each intention category can be further set by combining sentence patterns of the feedback content, emotion tendencies of the feedback content, positions of keywords in the feedback content, actual requirements and other different dimensional information, and the invention is not particularly limited to this.
S103, determining an intention recognition result of target feedback content by utilizing a pre-trained intention classification model if the initial category is judged to be a designated category, otherwise, determining the initial category as the intention recognition result of the target feedback content, wherein the designated category is an intention category with similar intention category, the intention classification model is a classification model obtained by training based on a plurality of sample feedback contents, and the plurality of sample feedback contents comprise sample feedback contents capable of representing the designated category and sample feedback contents capable of representing the similar intention category of the designated category.
The classification condition and the corresponding relation are manually set based on experience and requirements, and feedback opinions touched by the manual are limited, so that the set classification condition may not cover all possible situations, especially for a plurality of similar intention categories, when the target feedback content is often caused to meet a certain classification condition literally, the intention category which may be actually represented is the similar category of the intention category corresponding to the classification condition.
In order to improve accuracy of feedback intention recognition, a more similar intention category can be used as a designated category, and then an intention recognition result of target feedback content is determined by using a pre-trained intention classification model so as to correct an initial category. If the initial category is judged to be the designated category, the intention recognition result of the target feedback content is determined by utilizing a pre-trained intention classification model, specifically, the target feedback content is input into the pre-trained intention classification model, and the intention recognition result of the target feedback content is obtained. When the initial category is not the specified category, the initial category obtained by step S102 is also accurate, and therefore, the initial category can be determined as the intention recognition result of the target feedback content.
For example, if the desktop lock class and the application lock class are similar two intention classes, both the desktop lock class and the application lock class may be designated classes. When the desktop lock class is the specified class, the similar class is the application class, and when the application lock class is the specified class, the similar class is the desktop class. When the initial category is a desktop lock category, the intent classification module is used for redefining whether the target feedback content is characterized by the desktop lock category or the application category.
Alternatively, the intention classification model of each of the multiple groups of categories may be preset, where each group of categories includes multiple similar intention categories.
In one implementation, the way the classification model is trained based on the multiple sample feedback content may include:
The method comprises the steps of obtaining a plurality of sample feedback contents of a user aiming at a product, which are collected in advance, and calibration contents of each feedback content, wherein each sample feedback content comprises sample feedback contents capable of representing a specified category and sample feedback contents capable of representing similar intention categories of the specified category, the calibration contents of each sample feedback content are intention categories which can be represented by the sample feedback contents, and the calibration contents can be obtained through manual mode and the like;
And training the initial intention classification model by taking the feedback content and the calibration content of each sample as training data. The method comprises the steps of inputting feedback content of each sample into an initial intention classification model to obtain an intention recognition result of the feedback content of each sample, calculating a loss value based on the difference between the intention recognition result of the feedback content of each sample and calibration content, judging that the intention classification model converges to obtain a trained intention classification model if the loss value is smaller than a preset loss threshold, adjusting network parameters of the intention classification model if the loss value is not smaller than the preset loss value, and returning to the step of inputting the feedback content of each sample into the initial intention classification model to obtain the intention recognition result of the feedback content of each sample, so that the intention classification model is continuously trained. The generation method of the sample feedback content may refer to the generation method of the target feedback content, and will not be described herein.
The intent classification model may be an intent classification model trained based on a random forest classification model. The random forest classification model is formed by combining a series of independent decision trees, and each decision tree forms the minimum composition of the whole random forest algorithm. When the random forest classification model gives a piece of data to be classified, each decision tree can independently judge the input without influencing each other, and finally, the optimal classification result of the whole classifier is selected through voting. Individual decision trees tend to be weaker in decision making capability, but the decision making capability will be quite powerful by aggregating a series of decision trees.
In the scheme provided by the embodiment, the corresponding relation between each classification condition and the intention category can be established in advance, so that the intention category corresponding to the classification condition met by the target feedback content can be determined, and further, when the initial category is the designated category, the intention recognition result of the target feedback content is determined by using the intention classification model, and otherwise, the initial category is determined as the intention recognition result of the target feedback content. Therefore, the scheme can avoid manually determining the feedback intention of the user based on the feedback content of the user, and realize automatic recognition of the user intention of the target feedback content, so that the recognition efficiency can be improved.
In addition, the method adopts the mode of combining the corresponding relation between each classification condition and the intention category and the intention classification model, so that when the initial category obtained through the corresponding relation has similar categories, the initial category is corrected, and therefore, the accuracy of the intention recognition can be further ensured.
Based on the embodiment of fig. 1, as shown in fig. 2, the user intention recognition method for feedback content according to another embodiment of the present invention may further include, before S102:
s104, generating sentence vectors representing target feedback contents as target vectors;
Wherein, sentence vectors representing the target feedback content can be generated based on word vectors of the segmented words contained in the target feedback content. Specifically, the word segmentation of the target feedback content can be obtained through text segmentation and other modes, the word vector of each word segmentation is further determined, and sentence vectors representing the target feedback content are generated through the determined word vectors.
S105, calculating the distance between the target vector and each type of cluster in a clustering space, wherein the clustering space is established based on sentence vectors of sample feedback content, and each type of cluster in the clustering space is associated with an intention type;
Wherein, as can be seen from the foregoing embodiments, the intention category corresponding to each classification condition can be determined based on the collected sample feedback content. Specifically, sentence vectors of the collected sample feedback content can be clustered to generate a clustering space, a plurality of clustered clusters are obtained, and further associated intention categories can be set for each cluster according to actual use scenes and requirements.
After determining the target vector of the target feedback content, the distance between the target vector and each type of cluster can be calculated in the cluster space. The distance between the target vector and each cluster may be the cosine distance between the adjacent target and the centroid of each cluster. And the centroid of each cluster is the average value of sentence vectors contained in each cluster.
S106, determining a target class cluster with the distance between the target class cluster and the target vector being smaller than a preset threshold value, and determining an intention class associated with the target class cluster as a preselected class.
Wherein the preset threshold may be determined based on demand and experience.
The clustering space includes three clusters, namely a cluster A, a cluster B and a cluster C, wherein the intention category associated with the cluster A is an intention category A, the intention category associated with the cluster B is an intention category B, and the intention category associated with the cluster C is an intention category C. By calculation, the distance between the adjacent target and the cluster A is 0.2, the distance between the adjacent target and the cluster B is 0.4 and the distance between the adjacent target and the cluster C is 0.6. When the preset threshold is 0.5, the class cluster A and the class cluster B can be determined to be target class clusters. And further determining the intent category a and the intent category as preselected categories.
Accordingly, after obtaining the pre-category, in one implementation, the step S102 may include the following steps:
S102A, determining an intention category corresponding to the classification condition met by the target feedback content as an initial category based on the preset corresponding relation between each classification condition and the intention category and the pre-selected category.
Wherein optionally, in an implementation manner, in order to improve accuracy of user intention recognition, a classification condition satisfied by the target feedback content may be determined from each classification condition, and when there are a plurality of classification conditions satisfied by the target feedback content, an initial category may be determined from the determined plurality of classification conditions based on a preselected category. For example, an intention category corresponding to each of a plurality of classification conditions may be determined first, and it may be determined whether or not a preselected category exists in the determined intention category, and when the preselected category exists, the preselected category may be regarded as an initial category.
For example, the preset classification conditions include a condition 1, a condition 2, and a condition 3, the intent category corresponding to the condition 1 is a category 1, the intent category corresponding to the condition 2 is a category 2, and the intent category corresponding to the condition 3 is a category 3. When the target feedback content satisfies both the condition 1 and the condition 2 and the preselected category is category 1, category 1 may be taken as the initial category.
Alternatively, in another implementation, to increase the efficiency of user intent recognition, the initial category may be determined as follows:
searching for the classification condition corresponding to the pre-selected category from the preset corresponding relation between each classification condition and the intention category, determining the classification condition met by the target feedback content from the searched classification conditions, and determining the intention category corresponding to the classification condition met by the target feedback content based on the corresponding relation as the initial category.
For example, the preset classification conditions include a condition 1, a condition 2, and a condition, the intent category corresponding to the condition 1 is a category 1, the intent category corresponding to the condition 2 is a category 2, and the intent category corresponding to the condition 3 is a category 3. When the pre-selected category is category 1 and category 2, the classification condition satisfied by the target feedback content is determined from the conditions 1 and 2, and the intention category corresponding to the classification condition satisfied by the target feedback content is taken as the initial category.
In the scheme provided by the embodiment, the pre-selected category possibly met by the target feedback content can be screened from all the intention categories based on the sentence vector of the target feedback content, and the initial category of the target feedback content is further determined by combining the pre-selected category and the classification condition, so that the accuracy and the efficiency of user intention recognition can be improved.
Alternatively, in another embodiment of the present invention, the step S104 may include the following steps:
The method comprises the steps of determining key word segmentation contained in target feedback content, wherein the key word segmentation is a word segmentation belonging to a preset word segmentation type, generating word vectors of the key word segmentation, and generating sentence vectors representing the target feedback content based on the word vectors of the key word segmentation.
Before determining the keyword, the data processing may be performed on the target feedback content to remove special characters such as expressions in the target feedback content.
The keyword segmentation is a vocabulary belonging to a preset type, wherein the preset type can be determined according to actual requirements and experience. For example, the preset types may include a function type, an emotion type, and a request type, wherein the vocabulary of the function type may be a vocabulary describing function points of the application program, such as "interface", "application lock", "garbage collection", and the like. The emotion type vocabulary may be a vocabulary describing emotion tendencies, such as "good", "like", "bad", "too bad", "dislike", etc., and the request type vocabulary may be a vocabulary describing a desired request, such as "how to do", "how to set", "how to recover", etc.
In order to accurately determine the key word segmentation contained in the target feedback content, a key dictionary is pre-established, wherein the key dictionary contains word segmentation of a preset type. The key dictionary may be built based on a barker custom dictionary. For example, the custom keyword part in the barker custom dictionary is used as the keyword dictionary. After the target feedback content is obtained, the word segmentation appearing in the keyword dictionary in the target feedback content can be searched, namely the keyword segmentation of the target feedback content.
The dimensions of the generated word vectors described above may be determined based on experience and context. After the dimensions of the word vectors are predetermined, the word vectors of the keyword segmentations may be generated in a variety of ways, for example, the word vectors of the keyword segmentations may be generated in one of two ways:
in the first way, word vectors of key words can be generated using the TF-IDF (Term Frequency-inverse document Frequency) algorithm.
In a second way, word vectors for the keyword segmentations may be generated based on the word vector model. The word vector model may be a word2vec word vector model, or may be a GloVe (Global vectors for word representation, global vector represented by a word) word vector model, and the model to be selected may be determined in combination with actual requirements.
After generating the word vector of the keyword, a sentence vector representing the target feedback content may be generated based on the word vector, wherein the sentence vector representing the target feedback content and the word vector of the keyword have the same dimensions.
Alternatively, in one implementation, the sentence vector of the target feedback content may be calculated based on the word vector of the keyword and the word vector of the non-keyword, where the non-keyword is a word except the keyword in the words included in the target feedback content.
The keyword dictionary which is introduced into the junction word custom dictionary can be pre-built, the keyword dictionary contains custom keywords, the custom keywords can be determined by combining actually used scenes, experiences and sample sets, and meanwhile, a general dictionary also exists in the junction word custom dictionary. After the target feedback content is obtained, the key word segments contained in the resultant word segment custom dictionary and the non-key word segments contained in the universal dictionary can be screened out.
And generating word vectors of the keyword and word vectors of the non-keyword according to the same dimension, and performing vector operation on the word vectors of the keyword and the word vectors of the non-keyword to calculate sentence vectors of the target feedback content.
Alternatively, the sentence vector of the target feedback content may be calculated in one of two ways:
The first mode comprises the steps of calculating the product of word length of target feedback content and word vector of keyword segmentation to obtain a first word vector, and carrying out weighted average on the first word vector and word vector of non-keyword segmentation to generate sentence vector of the target feedback content.
In this way, the word length of the target feedback content is the number of divided words, i.e. the sum of the number of key words and non-key words, of the target feedback content. The ratio of the word vector of the keyword in the sentence vector can be enhanced by multiplying the word length by the word vector of the keyword, so that the emotion tendency carried by the keyword is prevented from being covered by the non-keyword, and the user intention recognition is more accurate.
The second mode is that the product of the preset multiple, the word length of the target feedback content and the word vector of the keyword is calculated to obtain a second word vector, and the second word vector and the word vector of the non-keyword are weighted and averaged to generate the sentence vector of the target feedback content.
In the mode, the ratio of the word vector of the keyword segmentation to the sentence vector is further improved through the preset multiple, and the accuracy of user intention recognition is further improved. The preset multiple may be determined based on actual requirements and experience, for example, may be 3 times.
Optionally, in another embodiment of the present invention, the method for identifying user intention for feedback content may further include:
According to a preset mapping relation between preset segmentation words and sub-categories under the intention recognition result, determining sub-categories with mapping relation with preset segmentation words contained in target feedback content as sub-categories of the target feedback content.
Wherein the intent category may include a plurality of subcategories. For example, the intent category may include a file cleaning sub-category, a picture cleaning sub-category, and a video cleaning sub-category under the cleaning category. Different sub-categories are used to further subdivide the user intent of the feedback content so that the user intent is identified more accurately.
Each subcategory which can be contained in the intention category is pre-established with a mapping relation with a preset word segmentation. Under the same intention category, preset word segmentation mapped by different subcategories are mutually different. The preset word segmentation of each subcategory can be recorded by establishing a subcategory keyword dictionary.
The intent class is exemplified by the clean class. Each subcategory which can be contained in the cleaning category is pre-established with a mapping relation with a preset word segmentation. Under the same intention category, preset word segmentation mapped by different subcategories are mutually different. For example, the intent category is a cleaning category that includes three subcategories of file cleaning subcategories, picture cleaning subcategories, and video cleaning subcategories. The preset word having a mapping relation with the file cleaning sub-category may be "file", "manuscript", etc., the preset word having a mapping relation with the picture cleaning sub-category may be "picture", "photo", etc., and the preset word having a mapping relation with the video cleaning sub-category may be "video", "movie", etc. When the target feedback content contains "video", then the video cleaning subcategory may be determined to be a subcategory of the target feedback content.
In the scheme provided by the embodiment, the sub-category of the target feedback content can be determined on the basis of the intention recognition result by presetting the mapping relation between the segmentation word and the sub-category under the intention recognition result. The target feedback content can be further subdivided, so that the user intention can be accurately identified.
Corresponding to the method for identifying user intention for feedback content provided in the above embodiment, as shown in fig. 3, an embodiment of the present invention further provides a device for identifying user intention for feedback content, where the device includes:
the content acquisition module 301 is configured to acquire target feedback content to be identified;
The category determining module 302 is configured to determine, as an initial category, an intention category corresponding to a classification condition that is satisfied by the target feedback content, based on a preset correspondence between each classification condition and the intention category, where the intention category corresponding to each classification condition is an intention category that can be represented by the feedback content that satisfies the classification condition;
The result determining module 303 is configured to determine, if the initial category is determined to be the specified category, an intention recognition result of the target feedback content by using a pre-trained intention classification model, otherwise, determine the initial category as the intention recognition result of the target feedback content;
The intention classification model is a classification model trained based on a plurality of sample feedback contents, wherein the plurality of sample feedback contents comprise sample feedback contents capable of representing the designated category and sample feedback contents capable of representing the similar intention category of the designated category.
Further, the apparatus further comprises:
The vector generation module is used for generating sentence vectors representing the target feedback content as target vectors before the category determination module executes the determination of the intention category corresponding to the classification condition met by the target feedback content as the initial category based on the preset corresponding relation between each classification condition and the intention category;
The distance calculation module is used for calculating the distance between the target vector and each type of cluster in the clustering space, wherein the clustering space is established based on sentence vectors of sample feedback content, and each type of cluster in the clustering space is associated with an intention type;
the class cluster determining module is used for determining a target class cluster with the distance between the target class cluster and the target vector being smaller than a preset threshold value, and determining an intention class associated with the target class cluster as a preselected class;
The category determining module is specifically configured to determine, as an initial category, an intention category corresponding to the classification condition satisfied by the target feedback content based on a preset correspondence between each classification condition and the intention category and a pre-selected category.
Further, the category determining module is specifically configured to search for a classification condition corresponding to the pre-selected category from a preset correspondence relation between each classification condition and the intention category, determine a classification condition satisfied by the target feedback content from the searched classification conditions, and determine, as the initial category, the intention category corresponding to the classification condition satisfied by the target feedback content based on the correspondence relation.
Further, the vector generation module is specifically configured to determine a keyword that is included in the target feedback content, where the keyword is a word that belongs to a preset word type, generate a word vector of the keyword, and generate a sentence vector that represents the target feedback content based on the word vector of the keyword.
Further, the intention classification model is a intention classification model trained based on a random forest classification model.
Further, the apparatus further comprises:
The sub-category determining module is used for determining sub-categories with mapping relation with preset segmentation words contained in the target feedback content according to preset mapping relation between the preset segmentation words and sub-categories under the intention recognition result, and the sub-categories are used as sub-categories of the target feedback content.
The embodiment of the invention also provides an electronic device, as shown in fig. 4, which comprises a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 complete communication with each other through the communication bus 404,
A memory 403 for storing a computer program;
The processor 401 is configured to implement the above-mentioned user intention recognition method steps for the feedback content when executing the program stored in the memory 403.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor including a central Processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc., or may be a digital signal processor (DIGITAL SIGNAL Processing, DSP), application Specific Integrated Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of any of the above methods for identifying user intention with respect to feedback content.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the user intent recognition methods for feedback content of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for an apparatus, an electronic device, a computer readable storage medium, a computer program product, a description is relatively simple, as it is substantially similar to the method embodiments, as relevant see also part of the description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.