Emotion Detection From Text
Emotion Detection From Text
Abstract:- Detecting emotion from text is a relatively new classification task and advancements in textual
analysis have allowed the area of emotion detection to become a recent interest in the field of natural language
processing. There is still a question on how to detect emotion from a text input. To solve this problem, this
project generates an Emotion Detection Model to extract emotion from text at the sentence level. The proposed
methodology does not depend on any existing affect lexicons such as WordNet Affect. Our method detects
emotion from a text-input by searching direct emotional key words from that input. To make the detection more
accurate, emotion-affect-bearing words and phrases were also analyzed. The experiments show that the method
could generate a good result for emotion detection from text input. To detect emotion from text we have
considered Ekmans six emotions class (joy, sadness, anger, disgust, fear, surprise). Our approach showed above
77% accuracy in detecting emotion from text input.
Keyword:- Language Processing, EmotionEstimation, Methodologies, Experiment, Result &Discussion, Futer
Network.
I.
INTRODUCTION
Emotion is one type of affect, other type of being mood, temperament and sensation. Emotions have
been widely studied in psychology and in behavior sciences, as they are an important element of human nature.
Nowadays they have also attracted the attention of researchers of computer science, especially in the field of
human computer interactions. Advancement in textual analysis have allowed the area of emotion detection to
become a recent interest in computational linguistic. Emotion detection is the newer area of textual analysis and
therefore, has weaker standard methods.
Emotion can be expressed as happiness, sadness, anger, disgust, fear, surprise and so forth. While
board topic of emotion has been studied in psychology for decades, very little effort has been spent on
attempting to detect emotion from text. In this work, we assume that emotion reaction of an input sentence is
essentially represented by its word appearance.
1.1: RELATED WORK: The concept of affective computing in 1997 by Since Picard proposed that the role of
emotion in human computer interaction. This domain attracted many researchers from computer science,
biotechnology, psychology, and cognitive science and so on.
This sub-section outlines some lexical resources that researchers have compiled over the years to
support affective computing and a verity of recently proposed methodologies.
Lexical resources: One of the first such resources was a list of 1,336 adjectives manually labeled in
Predicting the semantic orientation of adjectives in the year 1997. WordNet-Affect was introduced hierarchy
of affective domain labels in Wordnet-affect: an affective extension of wordnet in the year 2004. The
subjectivity lexicon developed by is comprised of 8,000 words. Motivated by the assumption that different
senses of the same term may have different opinion-related properties developed SentiWordNet, a lexicon based
on wordnetin the year 2006. An automatically generated lexicon called SentiFul database was introduced in
Sentiful Generating a reliable lexicon for sentinel analysis in the year 2009.
Emotion Detection Approaches: Emotion detection approaches can be broadly classified into keyword-based,
linguistic rules-based and machine learning technique.
Keyword-based Approaches using Affect Lexicon: Keyword based approaches are applied at the basic word
level. Such a simple model cannot cope with cases where affect is expressed by interrelated words.
Linguistic Rules-based Approaches: The ESNA system was developed to classify emotions in news headlines.
Chaumartin manually added seed words to emotion lists and created a few rules in their system UPAR7, which
identifies what is being said about the main subject and boosts its emotion rating by exploiting dependency
graph.
Machine Learning Approaches: To overcome the limitations faced by rule-based methods, researches devised
some statistical machine learning technique which can be sub-divided into supervised and unsupervised
techniques.
23
II.
LANGUAGE PROCESSING
2.1: Natural Language Processing: Natural language processing (NLP) is the computerized approach to analyze
text that is based on both a set of theories and a set of technologies. It is concerned with the interactions between
computers and human (natural) languages. NLP is presenting naturally occurring texts at one or more level of
linguistic analysis for the purpose of achieving human-like language processing for a range of tasks or
applications.
NLP has two major methods of analysis.
Keyword Analysis or Pattern matching technique.
Syntactic driven parsing technique.
2.1.1: Keyword Analysis: In keyword analysis or Pattern matching technique, the system scans the input
sentences for selective keywords and once they are encountered, the system responds with a built-in reply.
24
25
26
III.
EMOTION ESTIMATION
Emotion detection is modeled as a classification problem where one or more nominal labels are
assigned to a sentence from a pool of target emotion labels.
Our emotion detection framework contains two main modules:
1. Word-processing module and
2. Sentence Analysis.
The module named sentence analysis which is an easy but a lengthy process. In this module, we take 1000
sentences for testing purpose. These sentences are without emotional keywords where emotions are to be set
manually.
3.1: Word-processing Module: The Word-processing part consists of tokenization, Parts-of-speech tagging,
negative sentence extracting, and searching keywords from positive sentence. This enables us to extract
emotion-bearing words from a given sentence.
27
28
29
30
Related keywords
Happiness, happy, joyous, blissful, great, good, glad etc.
Wild, furious, bad, livid, hot, stormy, sore, angry etc.
Sad, sorry, tragic, depressed, unhappy, pensive, pitiful
etc.
Disturbed, annoying, suck, repel, offended, disgust etc.
Disgust
Panic, fear, worship, terror, horror, alarm, fright etc.
Fear
Surprise, break, seek, amazement, wonder, astonished,
Surprise
popeyed etc.
Table 2: Some examples from the SIX_EMOTIONS dataset
4.3.2. Extracting affect-word & phrases (ABW Analysis): The second step of our emotion detection
model is to extract the content-word and phrases. Sometimes words in a sentence affect more than a
single keyword. Consider a sentence, The players of Bangladesh Cricket Team were greeted with joyless
cheer. Our lexical resource SIX_EMOTIONS lists the word cheer under the emotion category
happiness. However in this sentence, emotional keyword cheer is highly influenced by the word
joyless, which make the emotional state of this sentence completely different. To solve this problem we
make an emotion labeled dataset named SENTENCE_DB with 151 sentences for testing purpose. In this
dataset, an input sentence is tagged with an emotion manually. The input sentence is tokenized into 2words, 3-words, 4-words and 5-words phrases. Then these phrases or affect bearing word are compared
with the phrases of the emotion labeled dataset. Once an emotional phrase is found in the dataset then that
sentence is assigned to a corresponding emotional result.
Emotional Class
Joy
Anger
Sadness
Disgust
Fear
Surprise
Related Sentences
4.3.3: Extracting exclamatory keywords (EXLA Analysis): To detect emotion from exclamatory sentences, our
emotion detection model aims to find out exclamatory keywords. This method is almost as similar as extracting
keywords method but the POS tagging feature is absent in this method. First of this step, the input sentence is
tokenized into single words. Then each word is compared with the elements of another emotion labeled dataset
named Excla_DB. Once a matched is detected between an input word and an element of the dataset, then that
entire sentence is tagged with an emotional reply by the method itself.
Emotion Class
31
34
28
25
17
Table 5: The number of manually emotion labeled sentences
31
11
IV.
The testing phase of our emotion detection model is done by taking some sample sentences from the
ISEAR dataset. The testing results are shown in the figure 5:
In this figure the blue line denotes the total number of input data, the red line denotes the total number of correct
sentence which was detected by the methods and the green line denotes the success rate of our three methods.
32
100
90
80
70
60
50
40
30
20
10
0
Number of Sentence
Correct Sentence
Success Rate (%)
KW
Analysis
EXLA
Analysis
ABW
Analysis
100
90
80
70
60
50
40
30
20
10
0
KW
Analysis
EXLA
Analysis
ABW
Analysis
33
V.
CONCLUSION
In our project, we propose three emotion detection methods to extract emotion from text input. Both the
keywords and Affect Bearing Word (ABW) are the main topic of our project to detect emotion from text.
Experiments proved that human emotion was deeply depended on the content word of the sentence. As we
know, it is still difficult to do the semantic parsing with machine learning method. Nevertheless, some part of
the semantic information and emotional keywords such as exclamatory keywords & direct emotional keywords
have been work out in the system. The result shows that we have got relatively good results for emotion
detection from text input.
Future Work
The future of emotion detection is promising. Although not enough time has spent to have established
standards in this field, the algorithms are continuing to increase in accuracy. In future we will try to increase the
resources of our affect lexicon and emotional dataset to increase the performance of our methods as well as to
increase the accuracy of the entire system.
There are many advantages in being able to identify emotion from text input. To being able to build
such kind of applications, the ability to detect emotion from text can enhance the human-computer interaction. If
the computer can tell a persons mood or emotional state, it would be able to switch to an accommodating form
of interaction.
REFERENCES
[1].
[2].
34