Top Banner
Emotion Detection Through Text By Kashif Kashif University of Bradford UK [email protected] Muhammad Yasir Muhammad ejaz khan University of Camerino Italy
28

Emotion Detection in text

Jan 22, 2017

Download

Science

Kashif Khan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Emotion Detection in text

Emotion Detection Through TextBy

Kashif KashifUniversity of Bradford [email protected]

Muhammad YasirMuhammad ejaz khan

University of Camerino Italy

Page 2: Emotion Detection in text

a strong feeling deriving from one's circumstances, mood, or relationships with others.

Emotions are complex. According to some theories, they are a state of feeling that results in physical and psychological changes that influence our behavior.

What is Emotions ?

Page 3: Emotion Detection in text

Anticipatory emotion: Desire and Fear Outcome Emotion: Happiness, sadness,

regret, relief

Basic Emotion

Types of Emotion

Page 4: Emotion Detection in text

Emotions may be expressed by a person's speech, facial and text based emotion

People use text messages for communication

Human recognize emotion easily but the problem is for machine.

Machine need accurate algorithm to recognize emotion from text

Text based recognitions also useful for psychologist

Introduction

Page 5: Emotion Detection in text

Hard Sensing: sensors provide the data sources that may be relevant to emotion recognition such as audio, gestures, eye gazes and brain signals

Soft Sensing: extract information from software that already exists with the user and analyzes it for the purpose of recognizing the user’s emotions.

Types of Sensing Method

Page 6: Emotion Detection in text

Sentiment Analysis also called opinion mining Basic components of an opinion

◦ Opinion holder: A person or an organization that holds an specific opinion on a particular object.

◦ Object: on which an opinion is expressed◦ Opinion: a view, attitude, or appraisal on an object

from an opinion holder. Objectives of opinion mining: many ... We use consumer reviews of products to

develop the ideas. Need Advancement of system Sentence Level Document level

Applications

Page 7: Emotion Detection in text

Human Computer Interaction Robot: Read code and exactly act like human Individual consumers Want to buy some thing, Review the websiteOrganization and business:Opinion mining

Application

Page 8: Emotion Detection in text

Strapparava et al. (2008) developed a system for Semantic Analysis to identify emotions in text when no affective words exist.

Drawback. achieved a low accuracy because it is not context sensitive.

Hancock et al. (2007) classify emotions as positive or negative. They found that

positive emotions are expressed in text by using more exclamation marks and words, while negative emotions are expressed using more affective words.

Drawback this method is limited to positive/negative

Literature Survey

Page 9: Emotion Detection in text

Ghazi et al. (2010) used hierarchical classification to classify

the six Ekman emotions. used multiple levels of hierarchy while

classifying emotions by first classifying whether a sentence holds an emotion or not,

classifying the emotion as either positive or negative

they achieved a better accuracy (+7%)

Literature Survey

Page 10: Emotion Detection in text

Recognition Method

Page 11: Emotion Detection in text

Simple and Easy method Find Specific word in the sentence Work on Three dimension Evaluation: this show how much a word is closed to happy or sadPotency: show strong and weak intensity of wordActivity: show passive or active activity of the

sentence

Keyword Based:

Page 12: Emotion Detection in text

Ambiguity in keyword:Meaning of same word could be different in

different places Sentence without keyword: sentence which have no keyword, then how

you find the emotionNegation Handling:I like this dress ,I don’t like this dressMultiple opinion in one sentence

Limitation

Page 13: Emotion Detection in text

Easy to use and straightforward method. An extension of keyword spotting technique; Assigns a probabilistic “affinity” for a particular

emotion to arbitrary words apart from picking up emotional keywords.

“I avoided an accident” or “I met my friend by accident”.

The word “accident” having been assigned a high probability of indicating a negative emotion.

Lexicon based Method

Page 14: Emotion Detection in text

When system receives the input and check the text weather it has keyword emotion or not.

If the text is available in the text apply KBM If not available check in the dictionary.

Hybrid based

Page 15: Emotion Detection in text

Formulate the problem differently. The problem was to determine emotions

from input texts but now the problem is to classify the input texts into different emotions.

Try to detect emotions based on a previously trained classifier.

Support Vector Machine, Hidden Morkov Model, KNN Algorithm etc

Machine based Learning

Page 16: Emotion Detection in text

K nearest neighbor Pick nearest on basis of DistanceFind when K=5 How can I determine the value of k, the number of neighbors?

◦ In general, the larger the number of training tuples is, the larger the value of k is

◦ To find the distance between two points use Euclidian distance.

Nearest-neighbor classifiers can be extremely slow when classifying test tuples O(n)

By simple presorting and arranging the stored tuples into search tree, the number of comparisons can be reduced to O(logN)

KNN Algorithm

Page 17: Emotion Detection in text

• Set of states: {s1, s2, s3…. sn}• Process moves from one state to another

generating a • sequence of states : s1, s2….• Markov chain property: probability of each

subsequent state depends only on what was the previous state:

Hidden Morkov Model

Page 18: Emotion Detection in text

You are going to find robot mood that either rebot is happy or sad by watching movie(W), sleeping S, Crying C, Facebook F.

X=h if you happy X=s if unknown Y observation . w, s, c or f . We want to answer queries, such as: P(X=h|Y=f) ? P(X=s|Y=c) ?

HMM

Page 19: Emotion Detection in text

HMM

Page 20: Emotion Detection in text

Conditional probability “Chance” of an event given that

something is true Notation:

◦ P(a/b) ◦ Probability of event a, given b is true

Byes Formula

Page 21: Emotion Detection in text

U stock D stock down P(G) Probability of Economic grown 70% P(U|G) Probability of Stock improve up What is the probability that economy grows

and stock went up P(G|U)

Byes Formula

Page 22: Emotion Detection in text

P(UG)=P(U|G)P(G)Called joint probability.(70%)(80%)=56% What is the probabilty That economy will grow P(G)=70%:UnconditionalP(G|U)=(P(U|G)P(G))/( P(U|G) + P(U|G’))P(G|U)=(80%)(70%)/(80%)(70%)+(30%)(30%)P(G|U)=56%/56%+9%=86%

Bayes formula

Page 23: Emotion Detection in text

Decision tree is a binary tree which is represented by nodes, tree work in recursive algorithm.

Decision Tree

Page 24: Emotion Detection in text

Rule 1: ignore the complete sentence before word “BUT” “We try to do our best to complete our work but it was difficult”. remove the sentence “we try our best to complete our work” Rule 2: Ignore sentence or phrase after the word “as”. “He is good as his father”. remove “his father”. remaining is

“He is good” Rule 3: remove the Verb to emotional word. Like “we had fun” , remove

“Had” relationship in between the word we and fun. Rule 4: Remove WP pronoun “What are you doing here it is not a good

place”. remaining part is “it is not a good place’ the last sentence shows some emotions here.

Approach on POS

Page 25: Emotion Detection in text

Data take the sentence Start with root node For every sentence do Extract into NP and VP For NP do Extract into POS Find noun END For VP do Extract into POS Find events Find verb END Repeat until all the phrases split END

POS Algorithem

Page 26: Emotion Detection in text

Parser Tree

Page 27: Emotion Detection in text

the ability to search based on emotions the ability to study how emotional

expression changes over time Different algorithm used to find the solution

for detection In Future, This system should also detect

not only the existence of keywords, but also their linguistic information to detect emotions more accurately

Conlcusion

Page 28: Emotion Detection in text

Kashif khan Beng Software Engineering. University of

Bradford UK Master Computer Science. University of

Camerino Italy

[email protected]

Writer Profile