-
-
Save terrillo/f7ea6a016e517ab773965ccea7214d07 to your computer and use it in GitHub Desktop.
classifier example
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 textblob.classifiers import NaiveBayesClassifier | |
from textblob import TextBlob | |
train = [ | |
('what did I miss', 'show-notifications'), | |
('what happen while I was gone', 'show-notifications'), | |
('any new events', 'show-notifications'), | |
('clear all', 'clear-notifications'), | |
('delete all','clear-notifications') | |
] | |
cl = NaiveBayesClassifier(train) | |
print cl.classify('delete everything') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment