Skip to content

Instantly share code, notes, and snippets.

Created Jun 7, 2021
What would you like to do?
from sklearn.feature_extraction.text import CountVectorizer
vect = CountVectorizer()
text = ["Hi, how are you", "I hope you are doing good", "My name is Aman Kharwal"]
train = vect.transform(text)
import pandas as pd
data = pd.DataFrame(train.toarray(), columns=vect.get_feature_names())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment