NLP, Topic Modeling, Data Science, Nlp Tutorial, Machine Learning.
that appear in less than 2 documents (min_df) or more than 95% (max_df) of the documents. from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer vec = TfidfVectorizer( max_features=5000, stop_words="english", max_df=0.95, min_df=2 ) features = vec.fit_transform(df.only_nouns)