Here sir told to use only transform() for testing data but what if testing data has some new word like in this case testing data had a new word rocks and when sir printed its vectorized form its frequency didn’t show as the word rocks is not present in the vocabulary so what to do in such cases?
Vectorization with stopward removal
Hey @devanshmarwaha27, when a word appears in testing data, than was not originally present in training data, than count vectorizer ignores that word while performing transform() function. You no need to do any thing.
Hope this resolved your doubt.
Plz mark it as resolved in my doubts section. 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.