python - adding words to stop_words list in TfidfVectorizer in sklearn -



python - adding words to stop_words list in TfidfVectorizer in sklearn -

i want add together few more words stop_words in tfidfvectorizer. followed solution in adding words scikit-learn's countvectorizer's stop list . stop word list contains both 'english' stop words , stop words specified. still tfidfvectorizer not take list of stop words , can still see words in features list. below code

from sklearn.feature_extraction import text my_stop_words = text.english_stop_words.union(my_words) vectorizer = tfidfvectorizer(analyzer=u'word',max_df=0.95,lowercase=true,stop_words=set(my_stop_words),max_features=15000) x= vectorizer.fit_transform(text)

i have tried set stop_words in tfidfvectorizer stop_words=my_stop_words . still not work . please help.

python scikit-learn classification stop-words text-classification

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -