Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.