Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. from textblob.classifiers import NaiveBayesClassifier
  2. from textblob import TextBlob
  3.  
  4. train = [
  5. ('what did I miss', 'show-notifications'),
  6. ('what happen while I was gone', 'show-notifications'),
  7. ('any new events', 'show-notifications'),
  8. ('clear all', 'clear-notifications'),
  9. ('delete all','clear-notifications')
  10. ]
  11.  
  12. cl = NaiveBayesClassifier(train)
  13.  
  14. print cl.classify('delete everything')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement