Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- corpus =
- [
- ("This is a sentence"),
- ("This is another sentence")
- ]
- corpus =
- [
- ("This is a sentence", "awesome"),
- ("This is another sentence", "not awesome")
- ]
- corpus =
- [
- {"text": "This is a sentence", "label": "awesome"},
- {"text": "This is another sentence", "label": "not awesome"}
- ]
- classifier = nltk.NaiveBayesClassifier.train(goods)
- print(classifier.show_most_informative_features(32))
- train = [({'some': True, 'tokens': True}, 'label'),
- ({'other': True, 'word': True}, 'different label'),
- ({'cool': True, 'document': True}, 'label')]
- classifier = nltk.NaiveBayesClassifier.train(train)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement