Created
January 28, 2018 07:47
-
-
Save dipanjanS/cf10b32330b533dd558b00da4c306a0f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from sklearn.feature_extraction.text import TfidfVectorizer | |
| tv = TfidfVectorizer(min_df=0., max_df=1., use_idf=True) | |
| tv_matrix = tv.fit_transform(norm_corpus) | |
| tv_matrix = tv_matrix.toarray() | |
| vocab = tv.get_feature_names() | |
| pd.DataFrame(np.round(tv_matrix, 2), columns=vocab) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment