Using WN-Affect to detect emotion/mood of a string

user3078335 picture user3078335 · Jan 14, 2015 · Viewed 8.2k times · Source

I downloaded WN-Affect. I am however not sure how to use it to detect the mood of a sentence. For example if I have a string "I hate football." I want to be able to detect whether the mood is bad and the emotion is fear. WN-Affect has no tutorial on how to do it, and I am kind of new to python. Any help would be great!

Answer

alvas picture alvas · Jan 14, 2015

In short: Use SentiWordNet instead and look at https://github.com/kevincobain2000/sentiment_classifier


In Long:

Affectedness vs Sentiment

The line between affect and sentiment is very fine. One should looking into Affectedness in linguistics studies, e.g. http://compling.hss.ntu.edu.sg/events/2014-ws-affectedness/ and Sentiment Analysis in computational researches. For now, let's call both the task of identifying affect and sentiment, sentiment analysis.

Also note that WN-Affect is a rather old resource compared to SentiWordNet, http://sentiwordnet.isti.cnr.it/.

Here's a good resource for using SentiWordNet for sentiment analysis: https://github.com/kevincobain2000/sentiment_classifier.

Often sentiment analysis has only two classes, positive or negative sentiment. Whereas the WN-affect uses 11 types of affectedness labels:

  • emotion
  • mood
  • trait
  • cognitive state
  • physical state
  • hedonic signal
  • emotion-eliciting
  • emotional response
  • behaviour
  • attitude
  • sensation

For each type, there are multiple classes, see https://github.com/larsmans/wordnet-domains-sentiwords/blob/master/wn-domains/wn-affect-1.1/a-hierarchy.xml


To answer the question of how one can use the WN-Affect, there're several things you need to do:

First map WN1.6 to WN3.0 (it's not an easy task, you have to do several mappings, especially the mapping between 2.0-2.1)

Now using the WN-Affect with WN3.0, you can apply

  • the same classification technique as he SentiWordNet sentiment classifier or
  • try to maximize the classes within text and then use some heuristics to choose 'positive' / 'negative'