Pustaka Taratsa
Testing the NLTK classifier on specific file

Testing the NLTK classifier on specific file

Penulis: Onno Widodo Purbo

The following code run Naive Bayes movie review classifier. The code generate a list of the most informative features. Note: **movie review** folder is in the nltk. from itertools import chain from nltk.corpus import stopwords from nltk.probability import FreqDist from nltk.classify import NaiveBayesClassifier from nltk.corpus import movie_reviews stop = stopwords.words('english') documents =