naive bayes classifier using bag of words for features