I want to use the Naive Bayes algorithm available on Text blob package in python. Does it classify "I love terrorism and I hate peace" and "I love peace and hate terrorism" the same way?
Asked
Active
Viewed 184 times
-5
-
1Have you tried to check yourself? This seems amenable to straightforward empirical verification... – juanpa.arrivillaga May 01 '17 at 18:26
-
2Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation. [on topic](http://stackoverflow.com/help/on-topic) and [how to ask](http://stackoverflow.com/help/how-to-ask) apply here. StackOverflow is not a design, coding, research, or tutorial service. – Prune May 01 '17 at 18:28
1 Answers
0
It depends solely on data representation. If you use bag-of-words (1-gram) representation, then yes, both documents will be the same. But if you use any n-grams with n>1, they will be different (and separable for NB). Basically nearly any "fancier" approach than simple bag-of-words will make NB distinguish between these two.

lejlot
- 64,777
- 8
- 131
- 164