Vectorized approach to multinomial Naive Bayes classifier