Created
June 19, 2018 02:11
-
-
Save ken333135/07b1dd31d786b9cc9a1bd63aa217b0a8 to your computer and use it in GitHub Desktop.
Get Top words for each class (multi-class text classification)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#creates an instance of the TfidfVectorizer | |
vect = TfidfVectorizer() | |
#fits the Tfidfvectorizer to your corpus, creating the vocabulary | |
vect.fit_transform(data_df['Your_freetext_column']) | |
#shows the fitted TfidfVectorizer and your corpus vocabulary | |
len(vect.vocabulary_) | |
vect.vocabulary_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment