Skip to content

Instantly share code, notes, and snippets.

@FranciscusRenatus
Created July 21, 2017 12:52
Show Gist options
  • Save FranciscusRenatus/cc5fb3b8be8c85982759aa0e914a8df2 to your computer and use it in GitHub Desktop.
Save FranciscusRenatus/cc5fb3b8be8c85982759aa0e914a8df2 to your computer and use it in GitHub Desktop.
# Creating the Bag of Words model
from sklearn.feature_extraction.text import CountVectorizer
cv = CountVectorizer(max_features = 1500)
X = cv.fit_transform(corpus).toarray()
y = dataset.iloc[:, 1].values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment