In my previous blog I introduced the key benefits to the use of voice in data capture and the importance of being able to analyse and extract emotion, having captured the data. In this blog, I provide a brief overview of the state of the art research for explicit and implicit emotion recognition in text. I cite articles used as sources and that provide a much more detailed critical assessment should you wish to find out more.
There are four main approaches for implicit emotion recognition in text:
- Keyword-based approaches – A keyword-based approach relies on finding occurrences of keywords in text and assigns an emotion label based on the identified keyword. The most commonly used approach is the keyword-spotting technique. First, a list of emotional words for each emotion label is pre-defined using lexicons. There are pre defined lexicons available and it is possible for custom lexicons to be developed for more specialist activities. A step of text pre processing, which includes tokenization, stop words removal, and lemmatisation (the process of reducing the different forms of a word to one single form) is performed on the dataset. The next step is to spot the emotion keywords present in the text using the predefined emotion keyword list. After that, the intensity of the emotion is analysed. Then, negation checking is performed. Finally, the emotion label for each sentence can be determined.
- Rule-based approaches – A rule-based approach is based on the use of knowledge to interpret and classify information in a useful way. The main steps of a rule-based approach, in emotion detection, include.
- First, text pre-processing is performed on the dataset. The pre-processing includes steps described in the keywords approach above i.e. tokenization, stop words removal, lemmatisation and analysing the grammatical structure of a sentence.
- Then, the emotion rules are extracted using linguistic, statistics, and computational concepts. The most performant rules are then selected.
- Finally, the rules are applied to the emotion dataset to determine the emotion labels. For example the Ortony, Clore, and Collins (OCC) model consists of five variables: direction, tense, overall sentence polarity, event polarity, and action polarity.
- Classical learning-based approaches – A classical learning-based approach provides analytical systems with the ability to automatically learn and improve based on experience from previously seen data. Machine learning algorithms are often categorized as supervised (classifying into a pre determined structure) or unsupervised (allowing the algorithm to identify patterns with no pre-determined classification structure, often based on distance calculation between data points). The most used classification based on review of research papers is SVM (Support Vector Machine) which is a supervised machine learning algorithm. As with other emotion detection approaches the main steps of SVM for emotion recognition reflect those process steps described for other approaches i.e. text pre-processing is performed on the dataset first. Second is to extract useful features. Finally, the features with the most information gain are selected. Given the feature set and emotion labels, the SVM algorithm outputs an optimal hyperplane. A detailed description of the optimal hyperplane is a little beyond the scope of this blog but very simply it is the line that correctly classifies all the data while being farthest away from the individual data points. Finally, the trained SVM model is used to classify emotions in unseen text.
- Deep learning approaches – Deep learning is a branch of machine learning in which programs learn from experience and understand the world in terms of a hierarchy of concepts. Deep learning defines each concept in terms of its relation to simpler concepts. This methodology allows a program to learn complicated concepts by building them based on simpler ones. Not unlike the approach that humans take to learning complex tasks and skills. The most used deep learning model when concerned with emotion analysis is long short-term memory (LSTM). LSTM is a particular form of recurrent neural network (RNN). LSTM overcomes the vanishing or exploding gradient problem which can be common in RNNs. Put very simply the vanishing gradient problem can render a deep learning algorithm non performant. As with all approaches described so far, there are a series of main steps for LSTM in emotion recognition in text. Text pre-processing is the first step (tokenization, stop words removal, and lemmatisation). After that, the embedding layer is built and is fed into one or more LSTM layers. Subsequent to this, the output is fed into a dense neural network (DNN) with units equal to the number of emotion labels and an S shaped mathematical function to perform the emotion classification.
- Hybrid approaches – As the name suggests a hybrid approach utilises a combination of measures. Typically, a blend of keyword-based and learning-based approaches. Initially, the system searches for emotion keywords in a sentence using the emotional keyword dictionary (EKD), which consists of words that express emotional meaning. If the system finds at least one emotional keyword, then the sentence is classified according to the EKD. However, should the input sentence not be found to contain any emotional keyword, then the knowledge-based artificial neural network (KBANN) classifier is brought into use. The KBANN is a type of artificial neural network (ANN) that uses domain knowledge to initialize the network. Except for neutral emotions, each emotion is trained to be recognized by a separate KBANN. A structured knowledge base is also created, as part of a hybrid approach, to store semantic and linguistic information for frame elements. The emotions are then recognised via a matching process.
Citations and references:
Khanna P., Sasikumar M. (2011) Recognizing emotions from human speech. In: Pise S.J. (eds) Thinkquest~2010. Springer, New Delhi. https://doi.org/10.1007/978-81-8489-989-4_40
SVM Tutorial – Understanding the Math: https://www.svm-tutorial.com/2015/06/svm-understanding-math-part-3/
The Cognitive Structure of Emotions – https://www.cambridge.org/core/books/cognitive-structure-of-emotions/33FBA9FA0A8A86143DD86D84088F289B
