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

前端 未结 2 1045
青春惊慌失措
青春惊慌失措 2020-12-09 06:23

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 detec

相关标签:
2条回答
  • 2020-12-09 06:41

    WordNet-Affect uses WordNet 1.6 offsets.

    However, WordNet 1.6 is still available for download. You can use the nltk.corpus.WordNetCorpusReader class to load it. I wrote all the code to do it here.

    0 讨论(0)
  • 2020-12-09 06:47

    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'
    0 讨论(0)
提交回复
热议问题