Full length articleUnderstanding Emotions in Text Using Deep Learning and Big Data
Introduction
Technology is continuously evolving to amplify human ingenuity, to make our day to day life simpler and, to anticipate and address our unmet needs. In order to anticipate our needs, it is essential for machines or computers to be able to deeply understand human behavior. Human behavior is very complex. Culture, social norms, faith, language among many other things, play a role in defining human behavior. In particular, understanding and expressing emotion is a key element of human behavior. Emotions must be deeply understood by machines and computers, to be able to anticipate human needs.
Emotions such as happiness, anger, sadness etc. are physiological states that humans routinely experience. In the field of cognitive computing, where we develop technologies to mimic functioning of the human brain, understanding emotions is an important area of research (Thilmany, 2007). With growing prominence of messaging platforms like WhatsApp and Twitter, there is an increased interaction using textual dialogues. There are several digital agents and chat bots on these messaging platforms and are currently being used by a large number of online users. The success of these agents depends on their ability to modulate responses based on user emotions for which it is imperative to be able to detect emotions in textual dialogues and avoid responding inappropriately (Miner et al., Linos).
Furthermore, ability of machines or computers to understand emotions is critical for success of several other applications as well. For instance, in the domain of customer service, social media platforms like Twitter are gaining prominence where customers expect quick responses. In case of heavy flow of tweets, turn-around time for responses increase. Prioritizing tweets according to their emotional content and responding to them in that order will result in increased customer satisfaction. For example, responding to an angry tweet prior to a basic inquiry. Furthermore, in this era of text messaging, users are constantly texting and may send inappropriately angry messages to others. If emotion detection is implemented, in such cases, the application can take appropriate action such as popping up a warning to the user before sending a message. Emotion detection also finds social applications such as flagging content representing bullying, depression etc. from Twitter streams or online fora. Thus, emotion detection in textual dialogue finds several applications in today's online world.
Emotions have been studied by researchers (Hochschild, 2002; Lane et al., 1996; Plutchik, 1994) in the fields of psychology, sociology, medicine, computer science etc. for the past several years. Some of the prominent work in understanding and categorizing emotions include Ekman's six class categorization (Ekman) and Plutchik's “Wheel of Emotion” which suggested eight primary bipolar emotions (Plutchik & Kellerman, 1986). Given the vast nature of study in this field, there is naturally no broader consensus on the granularity of emotion classes. Hence, as a first-step, we restricted our current study to the top three frequently observed emotions in our user logs – Happy, Sad and Angry. Problem Definition In a textual dialogue, given the user utterance along with its context, classify the emotion of user utterance as one of Happy, Sad, Angry or Others.
Understanding emotions in textual conversations can be a challenging Problem in absence of facial expressions and voice modulations. Fig. 1 provides an example where it is difficult, even as a human, to detect the emotion of user utterance solely on the basis of text of the conversation. The emotion of the user whose messages are on the left, could be interpreted as angry or sad. The challenge of understanding emotions is further compounded by difficulty in understanding context, sarcasm, class size imbalance, natural language ambiguity and rapidly growing Internet slang. However, big data and powerful deep learning algorithms have paved way for us to attack this problem statement.
In this paper, we propose an end-to-end trainable deep learning model, called “Sentiment and Semantic Based Emotion Detector (SS-BED)” for detecting emotions in textual dialogues. The essence of our approach lies in leveraging both the sentiment and semantic representations of user utterance for accurate emotion detection. The motivation behind combining sentiment and semantic representations can be understood from the following example. Let's consider the utterance “On road again … miss my amazing partner though!”. This utterance contains a negative sentiment word ‘miss’ as well as a positive sentiment word ‘amazing’ but the overall emotion of the utterance is Sad. By combining the sentiment of different words in the utterance with semantic understanding of the sentence, we can detect the emotion in this case. Hence, we intuitively feel combining both sentiment and semantic features helps in improving classification of emotions under such scenarios.
Given a user utterance, SS-BED takes the individual sentiment and semantic representations of their input words and combines them into a unified representation for the entire utterance which is used for predicting the emotion. We evaluate SS-BED on real world textual dialogues and it outperforms traditional Machine Learning approaches and other Deep Learning approaches. The main contributions of our paper are as follows:
- •
We propose a novel approach towards understanding emotions in textual conversations, using a deep-learning system called SS-BED.
- •
We evaluate various Deep Learning techniques and embeddings, along with Machine learning algorithms (such as Support Vector Machines (SVM), Decision Trees, Naive Bayes), on real world textual conversations and compare their effectiveness for the task of understanding emotions.
Practical Application: Our current research is in the context of an online chat-bot, designed for informal conversations with users. In this scenario, we notice that users often express a variety of emotions such as being nervous about exams, excited about a new job, feeling sad about a break-up, etc. In such cases, the boundaries between computers and humans blur, and users expect computers to deeply understand human behavior including emotions. Understanding these emotions and providing an emotionally aware response not only creates a deeper and sustained engagement with users but takes us a step closer to deeply understanding humans and anticipating their psychological needs.
The rest of the paper is organized as follows: Section 2 provides a summary of related work. Section 3 describes our approach (SS-BED) in detail. Our experimental setup is discussed in Section 4 and our results are in Section 5. Finally, Section 6 concludes the paper, followed by future direction for our work.
Section snippets
Related work
A lot of work has happened in the space of image based emotion recognition (Wang et al., 2018), (Zhang et al., 2016). However, classifying textual dialogues based on emotions is relatively new research area. Emotion-detection algorithms can be largely bucketized into following two categories:
- (a)
Hand-crafted Feature Engineering Based Approaches: - Many methods exploit the usage of keywords in a sentence with explicit emotional/affective value (Balahur et al., 2011; Chaumartin, 2007; Kozareva et
Our approach
We model the task of understanding emotions as a multi-class classification Problem where given a user utterance, the model outputs probabilities of it belonging to four output classes - Happy, Sad, Angry and Others. The architecture of our proposed SS-BED model is shown in Fig. 2. Our model uses LSTMs (Hochreiter and Schmidhuber, 1735), which are effective in processing sequential information. The input user utterance is fed into two LSTM layers using two different word embedding matrices. One
Experimental setup
In this section, we describe details of evaluation dataset used to compare various techniques and baseline methods used for comparison.
Results
A summary of results from various techniques on the dataset described in Section 4.1 is presented in Table 6. SS-BED gives the best performance on F1 score for each emotion class as well as on Macro and Micro F1, as can be seen more clearly from Fig. 3. The performance of SS-BED over all other models is particularly significant (p 0.005) as measured by McNemar's test (McNemar, 1969). Our results thus indicate that combining sentiment and semantic features in SS-BED outperforms individual
Conclusion
In this paper, we discuss Problem of understanding emotions in text by machines. To be able to anticipate human needs, emotions must be deeply understood by machines and computers, as understanding and expressing emotion is a key element of human behavior. Detecting emotions helps in modulation and regulation of responses for real-world chat-bot and other textual-dialogue based applications. For this problem, we harness the power of deep learning and big data and propose a Deep Learning based
Future work
As part of our future work, we plan to extend this approach to detect more emotional classes such as Surprise, Fear, Disgust etc. Currently, our model is limited by the fact that it does not train on the context of the dialogue. We plan to train models that also take the dialogue context into account besides the current user utterance.
References (63)
- et al.
Intelligent facial emotion recognition based on stationary wavelet entropy and jaya algorithm
Neurocomputing
(2018) - et al.
Emonet: Fine-grained emotion detection with gated recurrent neural networks
- et al.
Unsupervised emotion detection from text using semantic and syntactic relations
- et al.
Emotions from text: Machine learning for text-based emotion prediction
- R. C. Balabantaray, M. Mohammad, N. Sharma, Multi-class twitter emotion classification: A new approach, International...
- et al.
Detecting implicit expressions of sentiment in text based on commonsense knowledge
- L. Canales, P. Martínez-Barco, Emotion detection from text: A survey, processing in the 5th information systems...
Upar7: A knowledge-based system for headline sentiment tagging
- V. Chernykh, G. Sterling, P. Prihodko, Emotion recognition from speech with recurrent neural networks, arXiv preprint...
- C. Cortes, V. Vapnik, Support-vector networks, Machine Learning Vol. 20, pages...
Emotion classification of audio signals using ensemble of support vector machines
Enhanced sentiment learning using twitter hashtags and smileys
Sentiwordnet: A high-coverage lexical resource for opinion mining
Evaluation
The elements of statistical learning
Deep learning
Using hashtags as labels for supervised learning of emotions in twitter messages
The sociology of emotion as a way of seeing
Principal component analysis and factor analysis
Ua-zbsa: A headline emotion classification through web information
Imagenet classification with deep convolutional neural networks
The (un) predictability of emotional hashtags in twitter
Impaired verbal and nonverbal emotion recognition in alexithymia
Psychosomatic Medicine
TRSDL: Tag-aware recommender system based on deep learning–intelligent computing systems
Applied Sciences
Cited by (278)
The use of machine learning and deep learning models in detecting depression on social media: A systematic literature review
2024, Personalized Medicine in PsychiatryIn-depth investigation of speech emotion recognition studies from past to present –The importance of emotion recognition from speech signal for AI–
2024, Intelligent Systems with ApplicationsContextual emotion detection using ensemble deep learning
2024, Computer Speech and LanguageExploring online consumer review-management response dynamics: A heuristic-systematic perspective
2024, Decision Support SystemsNegative emotion detection on social media during the peak time of COVID-19 through deep learning with an auto-regressive transformer
2024, Engineering Applications of Artificial Intelligence