Created
July 15, 2020 08:13
-
-
Save yogeshnile/9c89cd50876c50f88b5bb56ac8f69534 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
#Save corpus for use in deployment | |
file_name = "corpus.pkl" | |
pickle.dump(corpus, open(file_name, 'wb')) | |
#Creating the Bag of Words model | |
from sklearn.feature_extraction.text import CountVectorizer | |
cv = CountVectorizer(max_features=2500) | |
X = cv.fit_transform(corpus).toarray() | |
#Extracting dependent variable from the dataset | |
y = pd.get_dummies(sms['label']) | |
y = y.iloc[:, 1].values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment