Blog #8
21 Aug 2017
In our last post we introduced sentiment analysis, the Naïve Bayes classification technique and why you or your business might be interested in this.
In this post we'll delve into it in more detail and and walk through an example and how it's connected to sentiment analysis.
The rule itself is written like this: (Boone)
p(AB) = p(BA) p(A) / p(B)
Now lets break this down and explain each component:
p(AB): ‘The probability of A given B’. This basically means the probability of finding observation A, given that some part of evidence B is there. This is what we want to find out. (Boone)
p(BA): This is the probability of the evidence turning up, given that the outcome obtains.
p(A): This is the probability of the outcome occurring, without the knowledge of the new evidence.
p(B): This is the probability of the evidence arising, without regard to the outcome.
The sample data set as discussed by (Amiune) illustrates how the theorem can be applied when trying to arrive at whether or not an email is spam if it has the word “buy” in the mail body.
P(spam words) = P(words/spam)P(spam) / P(words)
We have a database of 100 emails.
 60 of those 100 emails are spam
 48 of those 60 emails that are spam have the word "buy"
 12 of those 60 emails that are spam don't have the word "buy"
 40 of those 100 emails aren't spam
 4 of those 40 emails that aren't spam have the word "buy"
 36 of those 40 emails that aren't spam don't have the word "buy"

What is the probability that an email is spam if it has the word “buy” in the content?
The answer to the above is as follows:
 There are 48 emails that are spam and have the word "buy".
 And there are 52 emails that have the word "buy": 48 that are spam plus 4 that aren't spam.
If you'd like to learn more, click the image below to Download our Free Sentiment Analysis Whitepaper.
Or View Our Diary And Book In A Call
Also included in this eBook:
 The Difficulties Of Sentiment Analysis And The Solutions
 How To Train Your Classifier When Performing Sentiment Analysis
 What Is POS Tagging And How Can I Use It?