Created
October 27, 2022 03:35
-
-
Save Abhayparashar31/b511083141a0d8015dada646d8156091 to your computer and use it in GitHub Desktop.
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
from sklearn.feature_extraction.text import CountVectorizer | |
import pandas as pd | |
vectorizer = CountVectorizer() | |
X = vectorizer.fit_transform(cleaned_corpus) ## passing cleaned corpus | |
doc_term_matrix = pd.DataFrame(X.toarray(),columns= vectorizer.get_feature_names()) | |
print(doc_term_matrix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment