Detecting Emotion from Text and Emoticon
Tajul Islamα, Romana Rahman Emaσ & Md. Humayan Ahmedσ
Emotion detection from text and emoticon is related to the field of NLP (natural language processing). To detect emotion from text and emoticon, here we proposed some methodology. These methodologies solve the problem of detecting the emotion in the case of sentence level and emoticon. Our created method works based on keyword analysis (KA), keyword negation analysis (KNA), a set of proverbs, emoticon, a short form of words, exclamatory word and so on. To find emotion we created 25 emotion classes. This analysis should generate a better result for detecting emotion from the text and emoticon. Our method should give 80% accuracy.
Keywords: emotion class, emotion database, proverbs, emoticon, human-computer interaction.
Author α σ: Dept. of Computer Science and Engineering (CSE) North Western University, Khulna, Bangladesh.
σ : Dept. of Computer Science and Engineering (CSE) Sheikh Fazilatunnesa Mujib University, Jamalpur, Bangladesh.
Emotions are one kind of influence that is mainly generated by human thinking and internal activity . It is also one kind of human nature . Detecting emotions from text play a vital role in a human-computer interaction . Emotions can help for making a decision and also process cognitive relationship .
Mainly emotions are split into two kinds, i.e. positive emotions and negative emotions. Positive emotions are interest, laughter, happiness etc. Negative emotions are fear, anger, sadness and so on . There are different ways to find emotion such as image, speech, facial expressions, textual data, emoticons etc. Among all types of approaches, textual data is important for researchers. Here, mainly we have discussed text analysis and emotion.
Shiv N. et.al  described emotion detection from textual documents and blogs. They proposed two components: Emotion Detector, Emotion Ontology for finding emotion from the text.
Nadia A.et.al  proposed a framework that analyses text from emotion. Here they also worked with an emoticon. For finding emotion, they used DW(Data Warehouse) technique.
Abdul Hannan  detected emotion from text using NLP (natural language processing).Here he described mainly two kinds of NLP methods .i.e. keywords or pattern matching technique and parsing technique.
Shadi S.et.al  describes emotion detection from text generated automatically rules. These rules are called emotion-recognition rule (ERR). These ERR extracts from a lot of training set. This training set classified by K-nearest neighbours (KNN), PMI (Mutual point information).
To determine emotion from the text, we propose some method based on keyword class. These keywords class contains similar types of keywords, emoticon, proverbs, short from an exclamatory sentence.
Determine keyword class:
Emotion classes are determined by Basic emotions model (Ekman, Izard, Plutchik) and different psychological matter. Emotion class related keywords can be found from antonym and synonym.
4.1 Proverb match
In the proverb match method, we have fixed emotion class for proverbs based on sentence meaning of proverbs. At the last step, if proverb sentences exist then they give emotion. On the other hand, the emotion is not existed then goes to keyword class-based method for finding emotion.
Figure 1: Flowchart for detecting emotion from Proverbs
4.2 Keyword class-based method
In this method, we first took input sentence as input and the output is a name of emotion. The first step of this method is checking related keyword from the emotional database. If no related keywords found, it gave a simple message. On the other hand, if related keywords found then next step is negation check. At the last stage of all them go to the emotion class and give expected emotion.
Figure 2: Flowchart for finding emotion from keyword analysis
4.3 Emoticon and short tokenisation method
In the modern world, emoticon and short of play a vital role in expressing emotion in human language. Short form and emoticon are the shortest forms of expressing emotion. Here we mainly tokenize the word and spotting that it is short form or emoticon. After spotting that, it gives a suitable emotion class name.
We mainly collected these emoticons and short forms from different social media (Facebook, Twitter etc.)
Figure 3: Short Form or emoticon spotting technique
For finding emotion class, we have created almost 25 emotion class and 460 keywords that are related to emotion class. Moreover, we have also created emotion class for proverbs using sentence meaning, short form, emoticon, and exclamatory sentence related to emotion class. In below we are giving some examples.
Table 1: Some examples of emotion class and related keyword
Joyous, great, happiness, good, glad
Wild, furious, bad, hot, stormy
Sorry, tragic, depressed, unhappy, pensive
Disturbed, annoying, suck, repel, offended
Amazement, wonder, astonished, surprise.
Incapable, powerless, vulnerable
Captivated, attached, loving
Negation checking keywords:
Rarely, seldom, not, nor, can’t, isn’t, aren’t, never, none etc. these type of 100 keywords are in my keywords database.
Table 2: Some examples of emotion class and related Proverbs
Day of sorrow is longer than a month of joy; a constant guest is never welcome
A burnt child dreads the fire
Hit the ceiling
Shaking like a leaf
On pins and Needles
Cut your coat according to your cloth.
Table 3: Some examples of emotion and related short from
H8, is, plz, pls
A lot, f9, yd
Table 4: Some examples of emotion and related Emoticon
Table 5: Some examples of emotion and related exclamatory sentence
Related exclamatory keyword
Yahoo, hurrah, yay
V. PERFORMANCE RESULTS
We analysed many kinds of sentences for finding emotion from the text. For different kinds of sentences, we got a different kind of success rate based on our proposed methodologies. In case of calculating success rate, we have used the equation given below. We multiplied with hundred for finding percentage calculation:
Success rate= Number of correct sentence *100
Number of sentences given
Table 6: Success rate finding
Number of Sentences
Number of Correct sentences
Success rate (%)
For understanding the relationship among the number of the input sentence, a number of the correct sentences given emotion and success rate, we have given a graphical representation below. We find almost 80% correct output using all of our methodologies.
Figure 4: Graph for showing relationship among number of the input sentence, number of the correct sentences given emotion and success rate(%).
CONCLUSION AND FUTURE WORK
Detecting emotion is a vital field in case of human-computer interaction. In this paper, we proposed some methodologies to find emotion from text based on keyword class, negation checking, proverbs and so on. These methodologies work based on sentence level and emoticon. In future, we want to work with paragraph level and want to find a different methodology for solving this issue.
- Shiv Naresh Shivhare, Shakun Garg and Anitesh Mishra, “Emotion Finder: Detecting Emotion From Blogs and Textual Documents,” in International Conference on Computing, Communication and Automation (ICCCA 2015).
- Abdul Hannan, “Emotion Detection from Text,” in International Journal of Engineering Research and Development, volume 11, issue pp 23-34, July 2015.07,
- N. Fragopanagos* and J.G. Taylor, “ Emotion recognition in human-computer interaction,” Elsevier.
- C.Yang, K.H.-Y.Lin and H.-H.chen, “Emotion Classification using Web Blog Corpora”.
- Nadia Afroz, Mahim-Ul Asad, Lily Dey, Rudra Pratap Deb Nath and Muhammad Anwarul Azim, “An Intelligent Framework for Text-to-Emotion Analyzer,” in International Conference on Computer and Information Technology (ICCIT), 2015.
- Jasleen Kaur and Jatinderkumar R.Saini, “Emotion Detection and Sentiment Analysis in Text Corpus: A Differential Study with Informal and Formal Writing Styles,” in International Journal of Computer Applications (0975-8887), Volume 101-No 9, September 2014.
- Erik Cambria, Andrew Livingstone and Amir Hossain, “The hourglass of emotions,” Cognitive behavioural systems.Springer, 2012.
- Myriam D, Munezero, Calkin Suero Montero and John Pajunen, “Are They Different? Affect, Feeling, Emotion, Sentiment and Opinion Detection in Text,” in IEEE transactions on affective computing.
- Ruchi Hirat and Namita Mittal, “A survey on Emotion Detection Techniques using Text in Blog posts,” in International Bulletin of Mathematical Research, Volume 02, Issue 1, 2015.
- Manasa M Tilakraj, Deepika. D. Shetty, Nagarathna M. Shruthi K. and Sougandhika Narayan, “Emotion Finder: Detecting Emotions From Text, Tweets and Audio,” in International Journal of Scientific Engineering and Applied Science, Volume-2, Issue-5, May 2016.
- Shiv Naresh Shivhare and Prof. Saritha Khethawat, “Emotion Detection From Text”.
- Parrot, W.G, “Emotions in Social Psychology,” in Psychology Press, Philadelphia 2001.
- Shyamol Banerjee and Prof. Unmukh Dutta, “ Detecting of Emotions in Text: A Survey,” in International Journal of Advanced Engineering and Global Technology, Vol-03, Issue-12, December 2015.
- Huang, “Multimodal approaches for Emotion Recognition, A survey,” USA
- Chun-Chieh Liu, Ting-Hao Yang, Chang-Tai Hsieh and Von-Wun Soo, “Towards text-based Emotion Detection: A Survey and Possible Improvements,” in International Conference on Information Management and Engineering, 2009.
- Radim Burget, Jan Karasek and Zdenek Smekal, “Recognition of emotions in Czech newspaper headlines,” Radioengineering 20.1 (2011).
- Shadi Shaheen, Wassim El-Hajj, Hazem Hajj and Shady Elbassuoni, “Emotion Recognition from Text Based on Automatically Generated Rules,” in International Conference on Data Mining Workshop, IEEE, 2014.
- EC-C. Kao. et.al.” Towards Text Based Emotion Detection A Survey and Possible Improvements,” Information management and engineering, IEEE, 2009.
- R. Cowie, E. Douglas Cowie, N. Tsapatsoulis, G.Votsis and S.Kollias, “Recognition of Emotional States in Natural Human-computer interaction,” in IEEE signal processing magazine.
- C. Maaoui, A. Pruski and F. Abdat, “Emotion recognition for human-machine communication.”