Created
March 30, 2018 19:18
-
-
Save edwardleoni/cf2d7df455ae0046bd26beb88ee5ef5c 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 word_features import extract | |
import pickle | |
import sys | |
try: | |
f = open('classifier.pickle', 'rb') | |
except FileNotFoundError: | |
print('Classifier not found') | |
exit() | |
classifier = pickle.load(f) | |
f.close() | |
try: | |
features = extract(sys.argv[1]) | |
except IndexError: | |
print('No text supplied to classify') | |
print(classifier.classify(features)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment