Created
September 4, 2019 11:39
-
-
Save pemagrg1/974fa10137212022321b6b79a22316a7 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
import pickle | |
Project_path = "<path to project>" | |
model_path = Project_path + "/08. Multi-class_text_classification/models/model.pickle" | |
vectorizer_path = Project_path + "/08. Multi-class_text_classification/models/vectorizer.pickle" | |
vectorizer = pickle.load(open(vectorizer_path,'rb')) | |
model = pickle.load(open(model_path,'rb')) | |
pred = model.predict(vectorizer.transform(["i have got a new phone. its from Apple.. and i love it!"]))[0] | |
print ("predicted class:", pred) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment