Text emotion recognition method and device, computer equipment and storage medium

A technology of emotion recognition and text, applied in the computer field, can solve problems such as inaccurate recognition and achieve the effect of improving accuracy

Pending Publication Date: 2021-01-01
CHINA SOUTHERN POWER GRID DIGITAL GRID RES INST CO LTD
2 Cites 1 Cited by

AI-Extracted Technical Summary

Problems solved by technology

However, the existing emotion recognition methods...
View more

Method used

Because in the sample of natural acquisition, emotion classification is that the sample of calm is in the majority, in order to guarantee the data balance of training sample set, in the present embodiment to the emotion category that sample quantity is lower than certain threshold value in each emotion category that obtains, The number of samples of these emotion categories is increased by means of data enhancement, so that the number of samples in each emotion category in the sample set is balanced, so that the emotion recognition accuracy of the emotion recognition model trained by using this sample is improved. Wherein, the threshold can be set according to the actual situation.
In the above-mentioned embodiment, by carrying out data enhancement to the emotion class that quantity is few in the sample text, can increase the generalization of the model that training obtains; A group learning algorithm in the field) to build a model, which can greatly improve the accuracy of the algorithm.
The emotion recognition device of above-mentioned text, obtains by counting the term frequency of each word segment in the text to be recognized by statistics, and extracts the keyword associated with emotion in the text to be identified based on the word frequency of each word segment, and treats identification based on emotion dictionary The keywords associated with emotions in the text are replaced to obtain the replaced text, and the replaced text is input into the emotion recognition model determined through training to obtain the emotion classification result of the text to be recognized. The above device counts the word frequency of each word segment in the text, identifies keywords based on the word frequency, and replaces the keywords with emotional words, and uses the emotion recognition model to identify the emotion in the replaced text, and uses the trained model to identify It can improve the accuracy of emotion recognition.
The emotion recognition method of above-mentioned text, obtains by counting the word frequency of each word segment in the text to be ident...
View more

Abstract

The invention relates to a text emotion recognition method and device, computer equipment and a storage medium. The method comprises the steps of obtaining a to-be-recognized text; counting the word frequency of each word segment in the to-be-recognized text; extracting keywords associated with emotion in the to-be-recognized text based on the word frequency of each word segment; performing emotion word replacement on keywords in the to-be-recognized text based on an emotion dictionary library to obtain a replaced text; and inputting the replaced text into an emotion recognition model determined through training to obtain an emotion classification result output by the emotion recognition model. According to the method, word frequency statistics is carried out on each word segment in the text, keyword recognition is carried out based on the word frequency, emotion word replacement is carried out on keywords, emotion in the text obtained through replacement is recognized through the emotion recognition model, and the trained model is used for recognition, so that the emotion recognition accuracy can be improved.

Application Domain

Biological neural network modelsCharacter and pattern recognition +3

Technology Topic

Lexical frequencyComputer equipment +4

Image

  • Text emotion recognition method and device, computer equipment and storage medium
  • Text emotion recognition method and device, computer equipment and storage medium
  • Text emotion recognition method and device, computer equipment and storage medium

Examples

  • Experimental program(1)

Example Embodiment

[0061]In order to make the purpose, technical solutions, and advantages of this application clearer, the following further describes this application in detail with reference to the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the application, and not used to limit the application.
[0062]In one embodiment, such asfigure 1 As shown, a text emotion recognition method is provided. In this embodiment, the method is applied to a terminal for illustration. It is understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server. And through the interaction between the terminal and the server. In this embodiment, the method includes step S110 to step S150.
[0063]Step S110: Obtain the text to be recognized.
[0064]Among them, the text to be recognized refers to the text that needs emotion recognition; the text to be recognized can be obtained from the customer service system, or from the database, or from any other place. In one embodiment, obtaining the text to be recognized from the customer service system may obtain the text text as the text to be recognized; it is also possible to obtain the voice text and convert the voice text into the text text as the text to be recognized; wherein, the voice conversion text may be any one A way to achieve.
[0065]Step S120: Count the word frequency of each word segment in the text to be recognized.
[0066]In one embodiment, after word segmentation is performed on the text to be recognized, each word segment in the text to be recognized can be obtained. Word frequency is a commonly used weighting technique used in intelligence retrieval and text mining to evaluate the degree of repetition of a word for a document or a set of domain documents in a corpus. Counting the word frequency of each word segment in the text to be recognized can be achieved in any way. In a specific embodiment, counting the word frequency of each word segment in the text to be recognized includes: using a statistical method of word frequency inverse text frequency to count the word frequency of each word segment in the text to be recognized.
[0067]Term Frequency-Inverse Document Frequency (TF-IDF) technology is a commonly used weighting technology used for information retrieval and text mining. It can be used to evaluate a word’s relative value to a document in a document set or corpus. Importance. The importance of a word increases in proportion to the number of times it appears in the document, but at the same time it decreases in inverse proportion to the frequency of its appearance in the corpus. If a word is relatively rare, but it appears many times in this article, then it is likely to reflect the characteristics of this article.
[0068]Taking the key words of a document as an example, the easiest way is to calculate the word frequency of each word. Among them, the calculation method of term frequency can be expressed by the following formula: term frequency (TF) = number of occurrences of a word in an article/total number of words in the article; inverse document frequency is a measure of the general importance of a word, and its size is related to a word The common degree of is inversely proportional, and the calculation method can be expressed by the following formula: Inverse Document Frequency (IDF) = log (the total number of documents in the corpus/the number of documents containing the term + 1). Further, the calculation of the term frequency inverse document frequency of a term includes: determining the product of the term frequency of the term and the inverse document frequency as the term frequency inverse document value of the term: TF-IDF=term frequency (TF)*inverse document frequency (IDF) ); The higher the importance of a word to the article, the greater the TF-IDF value of the word.
[0069]Step S130: Extract keywords related to emotions in the text to be recognized based on the word frequency of each word segment.
[0070]Among them, words related to emotions refer to the words that can reflect emotions from a certain angle; in one embodiment, a keyword dictionary database related to emotions can be established, in which words that can reflect emotions, such as "haha", Words such as "hum", "uncomfortable", etc.; when extracting keywords in the text to be recognized, the text to be recognized can be divided into word segments, and the obtained word segments are sequentially combined with the words included in the keyword dictionary database The comparison can determine the keywords associated with emotions in the text to be recognized. In other embodiments, the keywords in the text to be recognized can also be extracted in other ways.
[0071]In another embodiment, when the word frequency inverse document frequency statistics method is used to count the word frequency of each word segment, a word segment with a word frequency value greater than a preset threshold is determined as a keyword. When the word frequency inverse document frequency statistics method is used to determine the word frequency of each word segment, the larger the word frequency, the more likely the word segment is to be a keyword in the text to be recognized; in this embodiment, a preset threshold is set to filter keywords And filtering, understandably, the preset threshold can be set according to actual conditions.
[0072]Step S140: Perform emotional word replacement on the keywords in the text to be recognized based on the emotional dictionary database to obtain the replaced text.
[0073]Among them, the emotional dictionary database contains emotional words, such as "happy", "sad", "angry", "doubt" and other words. In step S130, keywords associated with emotions have been extracted from the text to be recognized, and it can be further determined which emotion each keyword is associated with. In this step, based on the emotion words in the emotion dictionary database, Each keyword in the text to be recognized is replaced with a corresponding associated emotional word. In this embodiment, the text obtained after the replacement is recorded as the replaced text.
[0074]Step S150: Input the replaced text into the emotion recognition model determined by training to obtain the emotion classification result output by the emotion recognition model.
[0075]Among them, the emotion recognition model is a neural network model determined by training in advance using samples, and the training of the emotion recognition model can be implemented in any way. In one embodiment, the emotion recognition model is implemented using a random forest model.
[0076]Further, after receiving the replaced text, the emotion recognition model obtains the emotion classification result in the replaced text through a series of operations, that is, the emotion classification result of the text to be recognized.
[0077]The emotion recognition method of the text mentioned above uses statistics to obtain the word frequency of each word segment in the text to be recognized, and extracts the keywords associated with emotion in the text to be recognized based on the word frequency of each word segment, and treats the key words associated with emotion in the text to be recognized based on the emotion dictionary. The emotion-related keywords are replaced to obtain the replaced text, and the replaced text is input into the emotion recognition model determined by training to obtain the emotion classification result of the text to be recognized. In the above method, word frequency statistics are performed on each word segment in the text, keyword recognition is performed based on word frequency, and emotional word replacement is performed on the keywords. The replaced text is used to recognize the emotions in the text through the emotion recognition model, and the trained model is used to perform Recognition can improve the accuracy of emotion recognition.
[0078]In one embodiment, such asfigure 2 As shown, performing emotional word replacement on keywords in the text to be recognized based on the emotional dictionary database to obtain the replaced text includes steps S210 to S230.
[0079]Step S210: Determine the emotion category associated with each keyword.
[0080]When extracting keywords associated with emotions in the text to be recognized, it is already known that the words and emotions have an association relationship. In this embodiment, the specific emotion categories corresponding to each keyword are further determined; for example, the keyword is "haha ", it can be determined that the emotional category associated with the keyword is a positive emotion, such as happy, happy, etc., and the process of determining the emotional category of other keywords is similar.
[0081]Step S220: Search the target emotion word corresponding to the emotion category of each keyword in the emotion dictionary database.
[0082]After determining the emotion category corresponding to each keyword, the emotion word corresponding to this emotion category can be searched in the emotion dictionary database. In this embodiment, the found emotion word is recorded as the target emotion word.
[0083]In step S230, each keyword in the text to be recognized is replaced with the corresponding target emotional word to obtain the replaced text.
[0084]In this embodiment, each keyword in the text to be recognized is replaced with the corresponding target emotional word, and a piece of text containing multiple emotional words can be obtained. Then in the subsequent steps, the word frequency of the emotional word can be counted and based on this The word frequency of each emotion word in the text determines the emotion of the text.
[0085]In one embodiment, such asimage 3 As shown, obtaining the text to be recognized includes: step S310, obtaining the voice to be recognized; step S320, performing voice-to-text conversion on the voice to be recognized to obtain the text to be recognized.
[0086]Among them, the voice to be recognized refers to a speech paragraph that needs to recognize emotions. In one embodiment, the voice to be recognized can be obtained from a customer service system, or from a database, or from any other place. Further, the speech to be recognized is converted from speech to text, and the text corresponding to the speech to be recognized is obtained, which is the text to be recognized. In one embodiment, the speech-to-text conversion of the speech to be recognized may be implemented in one way.
[0087]Further, in one embodiment, the voice-to-text conversion of the voice to be recognized can also obtain the voice characteristics of the voice to be recognized; in a specific embodiment, the voice characteristics include volume characteristics and speech rate characteristics.
[0088]Furthermore, in one embodiment, please continue to refer toimage 3 Before inputting the replaced text into the emotion recognition model determined by training, the method further includes step S330 of acquiring the voice feature of the voice to be recognized.
[0089]Among them, the voice feature is a feature that characterizes the information of the voice to be recognized from a certain angle; in one embodiment, the voice feature includes a volume feature and a speech rate feature; further, in an embodiment, the speech rate and volume are respectively The division of speech rate and volume level is carried out. For example, the speech rate is divided into multiple levels, and each speech rate level corresponds to a speech rate. Similarly, the volume can also be divided into multiple levels, and each volume level corresponds to a level The volume level. After the speech to be recognized is obtained, the speech rate and volume corresponding to the speech are determined, and each is output as a separate feature.
[0090]In one embodiment, the voice feature of the voice to be recognized can be obtained when the voice is converted to text. In other embodiments, the voice feature of the voice to be recognized can also be obtained in other ways.
[0091]Further, please continue to referimage 3 In this embodiment, the replaced text is input to the emotion recognition model determined by training to obtain the emotion classification result output by the emotion recognition model, including step S151: splicing each word segment of the replaced text with the voice feature to obtain the word segment Features; Step S152: Input the features of each word segment into the emotion recognition model, and obtain the emotion classification results output by the emotion recognition model.
[0092]After the replaced text is obtained, the acquired speech features are spliced ​​with each word segment in the replaced text to obtain the corresponding word segment characteristics. When the emotion recognition model performs emotion recognition, input the speech feature spliced ​​word segment features into The emotion recognition model performs emotion recognition; that is, in this embodiment, the speech characteristics of the speech are combined to determine the emotion of the text corresponding to the speech, which can improve the accuracy of emotion recognition. Usually when people are affected by emotions, they will also have certain expressions in the volume and speed of the voice. For example, when they are angry, they usually increase the volume to express them, and when they are happy they may be expressed as increasing the speed of speech. In this embodiment, combining voice features to recognize emotions corresponding to a segment of voice can improve the accuracy of recognition.
[0093]In one embodiment, the training process of the emotion recognition model includes: obtaining sample text; counting the word frequency of each sample word segment in the sample text; extracting sample keywords associated with emotion from the sample text according to the word frequency of each sample word segment; The emotional dictionary database performs emotional word replacement on each sample keyword in the sample text to obtain the replaced sample text; input the replaced sample text and the emotion classification label of the sample text into a preset random forest model to obtain a trained emotion recognition model.
[0094]Among them, random forest is a classification method of ensemble learning, which constructs multiple decision trees during training, and outputs classes in the mode of a single tree output. In the input stage, multiple high-level decision trees are generated, and the output is generated in the form of multiple decision trees. Randomly select trees to reduce the correlation between trees, thereby improving prediction ability and improving efficiency. These predictions are achieved by combining predictions from various aggregate data sets.
[0095]In one embodiment, after obtaining the sample text, it further includes: respectively reading the emotion labels corresponding to each sample text, and separately counting the number of samples corresponding to each emotion label; performing data enhancement for the emotion labels whose sample number is lower than the threshold, and Obtain the data enhancement sample, mix the data enhancement sample with each sample text to obtain the updated sample text; extract the sample keywords associated with the emotion from the sample text, including: extract the sample keywords associated with the emotion from the updated sample text . Subsequently, the keywords extracted from the updated sample text are used to perform emotional word replacement and word frequency statistics, and based on the word frequency, the preset random forest model is trained to obtain the emotion recognition model.
[0096]Among them, the emotion label corresponding to the sample text represents the label information of the emotion category corresponding to this piece of sample text, and the emotion label of each sample text can be obtained after the sample text is obtained. Based on the tags corresponding to the obtained sample texts, the sample texts belonging to the same emotion label can be classified into the same sample category, and the sample number of each category can be counted to know the sample number of each emotion in each sample text obtained In the case of a small number of sentiment categories, if the number is lower than the threshold, the sample text in the sentiment category will be data-enhanced to increase the number of samples in this category, thereby making the number of samples in each sentiment category balance.
[0097]Data enhancement includes a series of techniques used to generate new training samples. These techniques are implemented by applying random jitter and disturbance to the original data without changing the class label. Our goal of applying data augmentation is to increase the generalization of the model. In this embodiment, data enhancement for emotion tags whose number of samples is lower than the threshold can be implemented in any manner.
[0098]Since the samples obtained naturally, the samples whose emotions are classified as calm account for the majority, in order to ensure the data balance of the training sample set, in this embodiment, among the obtained emotion categories, the number of samples is lower than a certain threshold, using data enhancement In this way, the number of samples in these emotion categories is increased, so that the number of samples in each emotion category in the sample set is balanced, so that the emotion recognition accuracy of the emotion recognition model trained using this sample is improved. Among them, the threshold can be set according to the actual situation.
[0099]In a specific embodiment, the preset maximum depth of the random forest model is 4, and the preset number of subtrees of the random forest model is 16. Among them, the maximum depth of the random forest (max_depth) represents the maximum number of features allowed for a single decision tree; the number of subtrees represents the number of subtrees that you want to build before using the maximum number of votes or average to predict.
[0100]In the above-mentioned embodiment, the generalization of the model obtained by training can be increased by data enhancement of a small number of emotion categories in the sample text; and the random forest is one of the machine learning fields through Bagging (Bootstrap aggregating). A group learning algorithm) to build the model can greatly improve the accuracy of the algorithm.
[0101]In another embodiment, obtaining the sample text includes obtaining the sample voice, performing voice-to-text conversion on the sample voice to obtain the sample text, and labeling the emotion category of the sample text. In this embodiment, the samples used for training the model are obtained by speech conversion. Since the speech-to-text process may have inaccurate recognition and conversion errors, it means that the sample text contains inaccurate recognition corpus. In this way, samples are obtained to train the model. Even when inaccurate recognition of speech-to-text occurs during use, the model can still more accurately identify the emotion classification corresponding to the speech to be recognized.
[0102]In a specific embodiment, the above text emotion recognition method includes four steps: data preprocessing stage, feature engineering, feature construction, and algorithm construction. It includes the following steps:
[0103]In the data preprocessing stage: ①At the data level, in order to balance the training set, the majority of categories are sampled, and data enhancement is used to increase the number of minority categories. ②At the algorithm level, it includes: adjusting the sample weight (adjusting the loss of misclassification); adjusting the decision threshold; modifying the existing algorithm to be more sensitive to rare classes.
[0104]In the feature engineering stage: extract keywords associated with emotions from the text to be recognized, and obtain the pre-judged emotions in the text to be recognized according to the emotion dictionary database (1024 words are built here), and use word embedding to convert them into Low-dimensional vector representation (that is, the above-mentioned emotion word replacement is performed on each keyword based on the emotion dictionary database to obtain the replaced text). The word frequency statistics method based on the word frequency inverse document frequency (TF-IDF) is used to count the word frequency of each word segment in the text to be recognized, and the high word frequency is the keyword. The method of word frequency inverse document frequency can be expressed by the following formula:
[0105]
[0106]Among them, tfi,j Represents the frequency of vocabulary i in a specific text j, idfiIndicates that the universal importance of word i in all texts is measured by a logarithmic function. n is the number of times the current word t appears in the text d, and D is the total number of texts in the corpus. |j:ti∈ dj| Represents the number of texts in the corpus with word i. Words with high TF-IDF value are keywords.
[0107]In the feature construction stage, audio-related features such as speech and speech speed are added.
[0108]In the algorithm model stage, random forest is used. Random forest builds models through Bagging, which can greatly improve the accuracy of the algorithm.
[0109]The above-mentioned text emotion recognition method can further improve the overall accuracy of the classification (anger, happiness) with a small amount of data by way of data balancing. Make full use of the emotional dictionary library to obtain useful information related to identifying emotions. Using random forest, by randomly selecting trees to reduce the correlation between trees, reduce the impact of missing up and down, external environmental noise, etc., thereby improving the prediction ability.
[0110]It should be understood that althoughFigure 1-3The steps in the flow chart of are displayed in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. and,Figure 1-3At least part of the steps in can include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times, and the order of execution of these steps or stages is not necessarily sequential. Instead, it may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
[0111]In one embodiment, such asFigure 4 As shown, a text emotion recognition device is provided, including: a text acquisition module 410, a word frequency statistics module 420, a keyword extraction module 430, a word replacement module 440, and an emotion classification module 450, wherein:
[0112]The text obtaining module 410 is used to obtain the text to be recognized.
[0113]The word frequency counting module 420 is used to count the word frequency of each word segment in the text to be recognized;
[0114]The keyword extraction module 430 is configured to extract keywords associated with emotions in the text to be recognized based on the word frequency of each word segment.
[0115]The word replacement module 440 is configured to perform emotional word replacement on keywords in the text to be recognized based on the emotional dictionary database to obtain the replaced text.
[0116]The emotion classification module 450 is configured to input the replaced text into the emotion recognition model determined by training to obtain the emotion classification result output by the emotion recognition model.
[0117]The above text emotion recognition device uses statistics to obtain the word frequency of each word segment in the text to be recognized, extracts keywords associated with emotions in the text to be recognized based on the word frequency of each word segment, and treats the words in the recognized text based on the emotion dictionary. The emotion-related keywords are replaced to obtain the replaced text, and the replaced text is input into the emotion recognition model determined by training to obtain the emotion classification result of the text to be recognized. The above device performs word frequency statistics for each word segment in the text, performs keyword recognition based on the word frequency, and performs emotional word replacement on the keywords. The replaced text is used to recognize the emotion in the text through the emotion recognition model, and the trained model is used for recognition It can improve the accuracy of emotion recognition.
[0118]In one embodiment, such asFigure 5 As shown, the text acquisition module 410 of the above device includes: a voice acquisition unit 411, configured to acquire a voice to be recognized; and a voice conversion unit 412, configured to perform voice-to-text conversion on the recognized voice to obtain the text to be recognized.
[0119]In one embodiment, the word replacement module 440 of the above device includes: an emotion category determining unit, used to determine the emotion category associated with each keyword; a searching unit, used to find the emotion category associated with each keyword in the emotion dictionary database Corresponding target emotional word; replacement unit, used to replace each keyword in the text to be recognized with the corresponding target emotional word to obtain the replaced text.
[0120]Further, in one embodiment, please continue to refer toFigure 5 As shown, the above-mentioned device further includes: a voice feature acquisition module 510, which is used to acquire the voice features of the voice to be recognized; in this embodiment, the above-mentioned emotion classification module 450 includes: a splicing unit 451, which is used to combine each text The word segment and the speech feature are spliced ​​to obtain the feature of each word segment; the input unit 452 is used to input the feature of each word segment into the emotion recognition model to obtain the emotion classification result output by the emotion recognition model.
[0121]In one embodiment, the above-mentioned device further includes a model training module, including: a sample acquisition unit for acquiring sample text; a statistical unit for counting the word frequency of each sample segment in the sample text; and a keyword extraction unit for acquiring The word frequency of each sample segment extracts sample keywords associated with emotions from the sample text; the replacement unit is used to perform emotional word replacement for each sample keyword in the sample text based on the emotion dictionary database to obtain the replaced sample text; training unit , Used to input the replaced sample text and the emotion classification label of the sample text into the preset random forest model to obtain the emotion recognition model determined by training.
[0122]In a specific embodiment, the preset maximum depth of the random forest model is 4, and the preset number of subtrees of the random forest model is 16.
[0123]In one embodiment, the word frequency statistics module 420 of the above-mentioned device is specifically configured to use a statistical method of word frequency inverse text frequency to count the word frequency of each word segment in the text to be recognized.
[0124]For the specific definition of the text emotion recognition device, please refer to the above definition of the text emotion recognition method, which will not be repeated here. Each module in the above text emotion recognition device can be implemented in whole or in part by software, hardware, and combinations thereof. The above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0125]In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be asFigure 6 Shown. The computer equipment includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, operator network, NFC (near field communication) or other technologies. The computer program is executed by the processor to realize a text emotion recognition method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, or a button, trackball or touch pad set on the housing of the computer equipment , It can also be an external keyboard, touchpad, or mouse.
[0126]Those skilled in the art can understand,Figure 6 The structure shown in is only a block diagram of part of the structure related to the solution of the application, and does not constitute a limitation on the computer equipment to which the solution of the application is applied. The specific computer equipment may include more or Fewer parts, or combine some parts, or have a different arrangement of parts.
[0127]In one embodiment, a computer device is provided, including a memory and a processor, and a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
[0128]Obtain the text to be recognized; count the word frequency of each word segment in the text to be recognized; extract keywords associated with emotion in the text to be recognized based on the word frequency of each word segment; perform emotional word replacement on the keywords in the text to be recognized based on the emotion dictionary database , Get the replaced text; input the replaced text into the emotion recognition model determined by training to obtain the emotion classification result output by the emotion recognition model.
[0129]In one embodiment, the processor further implements the following steps when executing the computer program: acquiring the voice to be recognized; performing voice-to-text conversion on the voice to be recognized to obtain the text to be recognized.
[0130]In one embodiment, the processor further implements the following steps when executing the computer program: determining the emotion category associated with each keyword; searching the emotion dictionary database for the target emotion word corresponding to the emotion category of each keyword; Replace each keyword in the corresponding target emotional word to obtain the replaced text.
[0131]In one embodiment, the processor further implements the following steps when executing the computer program: acquiring the voice feature of the voice to be recognized; splicing each word segment with the voice feature in the replaced text to obtain the feature of each word segment; combining the features of each word segment Input the emotion recognition model to obtain the emotion classification result output by the emotion recognition model.
[0132]In one embodiment, the processor further implements the following steps when executing the computer program: obtaining sample text; counting the word frequency of each sample word segment in the sample text; extracting the sample key associated with emotion from the sample text according to the word frequency of each sample word segment Words; based on the emotional dictionary database, perform emotional word replacement for each sample keyword in the sample text to obtain the replaced sample text; input the replaced sample text and the emotion classification label of the sample text into the preset random forest model to obtain the emotion determined by training Identify the model.
[0133]In one embodiment, when the processor executes the computer program, the processor further implements the following steps: read the emotion labels corresponding to each sample text, and count the number of samples corresponding to each emotion label; and perform data enhancement for emotion labels whose sample number is lower than the threshold , Get the data enhancement sample; mix the data enhancement sample with each sample text to get the updated sample text; extract the sample keywords associated with emotion from the updated sample text.
[0134]In one embodiment, the processor further implements the following steps when executing the computer program: using a statistical method of word frequency inverse text frequency to count the word frequency of each word segment in the text to be recognized.
[0135]In one embodiment, this application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0136]Obtain the text to be recognized; count the word frequency of each word segment in the text to be recognized; extract keywords associated with emotions in the text to be recognized; perform emotional word replacement on the keywords in the text to be recognized based on the emotion dictionary database to obtain the replaced text; After the replacement, the text input is trained on the determined emotion recognition model to obtain the emotion classification result output by the emotion recognition model.
[0137]In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: acquiring the voice to be recognized; performing voice-to-text conversion on the voice to be recognized to obtain the text to be recognized.
[0138]In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determine the emotion category associated with each keyword; search for the target emotion word corresponding to the emotion category of each keyword in the emotion dictionary database; Each keyword in the text is replaced with the corresponding target emotional word, and the replaced text is obtained.
[0139]In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the voice feature of the voice to be recognized; splicing each word segment with the voice feature in the replaced text to obtain the feature of each word segment; The features are input to the emotion recognition model to obtain the emotion classification results output by the emotion recognition model.
[0140]In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtain sample text; count the word frequency of each sample word segment in the sample text; extract samples related to emotion from the sample text according to the word frequency of each sample word segment Keywords; based on the emotional dictionary database, perform emotional word replacement for each sample keyword in the sample text to obtain the replaced sample text; input the replaced sample text and the emotion classification label of the sample text into the preset random forest model to obtain the training determined Emotion recognition model.
[0141]In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: read the emotion labels corresponding to each sample text, and count the number of samples corresponding to each emotion label; and perform data for the emotion labels whose sample number is lower than the threshold Enhance to obtain a data enhancement sample; mix the data enhancement sample with each sample text to obtain the updated sample text; extract the sample keywords associated with emotions from the updated sample text.
[0142]In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: using a statistical method of word frequency inverse text frequency to count the word frequency of each word segment in the text to be recognized.
[0143]A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage. In the medium, when the computer program is executed, it may include the procedures of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, or optical memory. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. As an illustration and not a limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM).
[0144]The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should It is considered as the range described in this specification.
[0145]The above-mentioned embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can be made, and these all fall within the protection scope of this application. Therefore, the scope of protection of the patent of this application shall be subject to the appended claims.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Imaging apparatus and flicker detection method

ActiveUS20100013953A1reduce dependencyimprove accuracy
Owner:RENESAS ELECTRONICS CORP

Color interpolation method

InactiveUS20050117040A1improve accuracy
Owner:MEGACHIPS

Emotion classifying method fusing intrinsic feature and shallow feature

ActiveCN105824922AImprove classification performanceimprove accuracy
Owner:CHONGQING UNIV OF POSTS & TELECOMM

Scene semantic segmentation method based on full convolution and long and short term memory units

InactiveCN107480726Aimprove accuracylow resolution accuracy
Owner:UNIV OF ELECTRONIC SCI & TECH OF CHINA

Classification and recommendation of technical efficacy words

  • improve accuracy

Golf club head with adjustable vibration-absorbing capacity

InactiveUS20050277485A1improve grip comfortimprove accuracy
Owner:FUSHENG IND CO LTD

Stent delivery system with securement and deployment accuracy

ActiveUS7473271B2improve accuracyreduces occurrence and/or severity
Owner:BOSTON SCI SCIMED INC

Method for improving an HS-DSCH transport format allocation

InactiveUS20060089104A1improve accuracyincrease benefit
Owner:NOKIA SOLUTIONS & NETWORKS OY

Catheter systems

ActiveUS20120059255A1increase selectivityimprove accuracy
Owner:ST JUDE MEDICAL ATRIAL FIBRILLATION DIV

Gaming Machine And Gaming System Using Chips

ActiveUS20090075725A1improve accuracy
Owner:UNIVERSAL ENTERTAINMENT CORP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products