Presentation is loading. Please wait.

Presentation is loading. Please wait.

Learn to Comment Lance Lebanoff Mentor: Mahdi. Emotion classification of text  In our neural network, one feature is the emotion detected in the image.

Similar presentations


Presentation on theme: "Learn to Comment Lance Lebanoff Mentor: Mahdi. Emotion classification of text  In our neural network, one feature is the emotion detected in the image."— Presentation transcript:

1 Learn to Comment Lance Lebanoff Mentor: Mahdi

2 Emotion classification of text  In our neural network, one feature is the emotion detected in the image  Generated comment should show similar emotion  Studied 2 papers

3 Detecting Emotion in Text Kaitlyn Mulcrone

4 Vector Space Model  Represent corpus as a term-by-document matrix  Row -> word  Column -> document  Entry in the matrix -> td-idf score of the word for the document

5 VSM Example  Document 1: You got a new phone?  Document 2: Your new dog is a cute dog! Document 1Document 2... You.060 Got.060 A00 New00 Dog0.08 Your0.04...

6 Matrix Reduction  Term-by-document matrix is too large and sparse  Latent Semantic Analysis (LSA) using Singular Vector Decomposition (SVD)  Returns an approximated matrix with smaller dimensions

7 Emotional synset vectors  Synset – set of all synonyms of a given word  For each emotion, retrieve the synset using WordNet lexicon  Get vectors for each synonym from the term-by-document matrix  Save each synset as a list of vectors Emotion (happiness) WordNet Synset joy glee delight Term-by- document matrix Vector Vector Vector Emotional synset vectors

8 Testing  Given input sentence, compare the sentence to each emotional synset  Choose the emotion whose synset is most similar to the sentence Sentence dog has joy Term-by- document matrix Vector Vector Vector Sentence word vectors happiness sadness fear Emotions cosine

9 Iterative method  For each word in the sentence, get the word’s vector from the term-by- document matrix  Compare each word in the input sentence to each word in the first emotional synset  Find cosine similarity (cosine of the angle between the vectors)  Take the average of the cosines

10 Iterative method joy glee delight Sentence word vectors dog has joy cosine Emotional synset vectors (happiness)

11 Iterative method joy glee delight Sentence word vectors dog has joy Emotional synset vectors (happiness) cosine

12 Iterative method joy glee delight Emotional synset vectors (happiness) Sentence word vectors dog has joy Similarity = average of all 9 of these cosines cosine

13 Combinational method  Treat all of the words in the input sentence as if they were the same word for each document d in matrix for each word w in sentence vector d = ( Σ tf w,d ) * ( Σ idf w,d )  Similarly, treat all of the words in the emotional synset as the same word  Find cosine similarity between the sentence vector and the emotional synset vector

14 Combinational method Sentence words dog has joy Term-by- document matrix tf, idf Sentence vector ( Σ tf ) * ( Σ idf ) Emotional synset words (for happiness) joy delight glee Term-by- document matrix tf, idf Emotional synset vector ( Σ tf ) * ( Σ idf ) cosine Similarity

15 Classification  Find cosine similarity between input sentence and all emotion synsets  Choose the emotion with the max value  For our method, probably save all cosine similarities as a descriptor

16 Prior and contextual emotion of words in sentential context Diman Ghazi, Diana Inkpen, Stan Szpakowicz

17 Lexicons  NRC-Emotion lexicon  dictionary of words and their corresponding emotions  8 emotions  Prior polarity lexicon  polarity (positive / negative / neutral / both)  type (weak / strong) 00010100 abandon angerantic.disgust fear joysadness trust surprise

18 Features  For the input sentence, find words that are in the emotional lexicon  Save features for each of these emotional words He was not sorrowful but instead excited. Features

19 Emotion-word features  Retrieved from lexicons  Emotion  Polarity

20 Part of speech features  Use Stanford tagger  Find the part of speech of the emotional word  Part of speech of 4 neighboring words

21 Dependency-tree features  Use Stanford parser

22 Dependency-tree features  neg – word is modified by negation word  amod – word is a noun modified by an adjective, or is an adjective modifying a noun  advmod – word is an adverb or head of adverbial phrase, or is modified by an adverb  modifies positive – word modifies a positive word form the prior-polarity lexicon  modifies-negative  modified-by-positive  modified-by-negative

23 Learning  Input these features into SVM or Logistic Regression  Logistic Regression had better results

24 Learning  For sentences with multiple emotional words:  For each emotional word, get probability distribution of emotional classes  For each emotional class, add up the probabilities for all of the emotional words  Select the class with the max probability

25 Future Work  Test Stanford CoreNLP code to extract features from input sentence  Organize features to be input into our neural network  Study other NLP methods


Download ppt "Learn to Comment Lance Lebanoff Mentor: Mahdi. Emotion classification of text  In our neural network, one feature is the emotion detected in the image."

Similar presentations


Ads by Google