I have a dataset of reviews which has a class label of positive/negative. I am applying Naive Bayes to that reviews dataset. Firstly, I am converting into Bag of words. Here
Try this:
pred_proba = NB_optimal.predict_proba(X_test) words = np.take(count_vect.get_feature_names(), pred_proba.argmax(axis=1))