In this section we formulate two different methods which utilize a corpus of emotion-labelled documents for sentiment analysis of text. The first method learns an emotion lexicon and further transforms it into a sentiment lexicon using the emotion-sentiment mapping (refer section2.2.2
(A) Emotion Corpus-EmoSentilex
(B) Emotion Corpus-Sentilex
FIGURE6.1: Emotion-Aware Models for Sentiment Analysis
labels for the documents in the emotion corpus using the emotion-sentiment mapping, followed by a sentiment lexicon extraction. The two proposed methods are illustrated visually in Figures
6.1aand6.1b.
6.2.1 Emotion Corpus-EmoSentilex
A simple way to utilize a corpus of emotion-labelled documents,XEfor sentiment analysis is to
first learn an emotion lexicon, and further transform it into a sentiment lexicon. An emotion lex-
iconEmolexin our case is a|V| ×(k+ 1)matrix, whereEmolex(i, j)is the emotional valence
corresponds to its neutral valence (refer chapter4). Further using the emotion-sentiment map- ping proposed in psychology we transform the emotion lexiconEmolexinto a sentiment lexicon
EmoSentilex, which is a|V| ×1matrix as follows:
EmoSentilex(i) =Log P m∈E+Emolex(i, m) P n∈E−Emolex(i, n) (6.1)
whereE+ ⊂ E andE− ⊂ E are the set of positive and negative emotions according to the emotion-sentiment mapping. In this research we consider emotions anger, sadness and fear
as negative emotions, whereas emotionsjoy, surprise and love as positive. Note that the log scoring assigns a positive value for words having stronger associations with emotions such as
joy, surprise and loveand negative values for words having stronger associations with emotions such as anger, sadness and fear. Therefore we expect that sentiment knowledge for words is implicitly captured in an emotion lexicon, which can be easily extracted using this simple transformation.
Using the above method, any automatically generated emotion lexicon can be converted into a sentiment lexicon. This is very useful on Twitter, since data (tweets) corresponding to the lexicons is not always available. Further it can also avoid the additional overheads involved in re-crawling the original data using the Twitter API. However, the above method does not model the document-sentiment relationships to learn the lexicon, which is important to quantify word-sentiment associations. Therefore we introduce an alternate method which overcomes this limitation while utilizing an emotion corpus for sentiment lexicon generation.
6.2.2 Emotion Corpus-Sentilex
An alternate way to utilize the emotion corpus,XE for sentiment analysis is to transform it into
a sentiment corpus,XSby learning the sentiment label for each documentd∈XE. This is done
by using the emotion-sentiment mapping as follows:
Sentiment(d) = positive if emotion(d)∈E+ negative if emotion(d)∈E− (6.2)
After the sentiment label for a document is obtained, we model each document in the corpus
XSto be a mixture of sentiment bearing words and neutral (background) words. This assump-
tion is reasonable, since an emotion-rich corpus also conveys sentiment but in a finer level of positive and negative concepts, such asjoy, surprise, anger, sadnessetc. Therefore we propose a generative model which assumes a mixture of two unigram language models to account for such word mixtures in documents. More formally our generative model is as follows to describe the generation of documents connoting sentimentP os,DP osas follows (similarly for negative
documentsDN eg): P(DP os, Z|θP os) = |DP os| Y i=1 Y w∈di [(1−Zw)λP osP(w|θP os) +(Zw)(1−λP os)P(w|N)]c(w,di) (6.3)
whereθP osis the sentiment language model andN is the background language model. λP osis
the mixture parameter andZw is a binary hidden variable which indicates the language model
that generated the wordw.
The estimation of parametersθP osandZis done using expectation maximization (EM), which
iteratively maximizes the complete data (DP os, Z) by alternating between E-step and M-step.
The E and M steps in our case are as follows:
E-step: P(Zw= 0|DP os, θP os(n)) = λP osP(w|θ(P osn)) λP osP(w|θ(P osn)) + (1−λP os)P(w|N) (6.4) M-step: P(w|θ(θn+1) P os ) = P|DP os| i=1 P(Zw= 0|DP os, θ (n) P os)c(w, di) P w∈V P|DP os| i=1 P(Zw = 0|DP os, θ(P osn))c(w, di) (6.5)
wherenindicates the EM iteration number. The EM iterations are terminated when an optimal estimate for the sentiment language modelθP osis obtained. Similarly, EM is used to estimate
the parameters of the mixture model corresponding to negative sentiment (N eg). Thereafter, the sentiment lexiconSentilexis learnt by using the two sentiment language models (θ(P osn),θ(N egn) ) and the background modelN as follows:
Sentilex(wi, θP os) =
P(wi|θP os(n))
P(wi|θ(P osn)) +P(wi|θ(N egn) ) +P(wi|N)
Sentilex(wi, θN eg) = P(wi|θ(N egn) ) P(wi|θ(P osn)) +P(wi|θ(N egn) ) +P(wi|N) (6.7) Sentilex(wi, N) = P(wi|N) P(wi|θ(P osn)) +P(wi|θN eg(n) ) +P(wi|N) (6.8)
whereSentilexis a|V|×3matrix, andSentilex(i, P os),Sentilex(i, N eg)andSentilex(i, N)
are the positive, negative and neutral valences corresponding to theith word in vocabularyV. Observe that unlike the method which learnsEmoSentilex, by aggregating word-level emotion scores into sentiment scores, this method learns the sentiment-class knowledge corresponding to the documents, before learning a word-sentiment lexicon. We expect this additional layer of supervision to improve performance in sentiment analysis. Further details about our proposed lexicon generation method can be found in Chapter4