from nltk import FreqDist
from nltk.classify.naivebayes import NaiveBayesClassifier

def make_training_data(rdr):
    for c in rdr.categories():
        for f in rdr.fileids(c):
            yield FreqDist(rdr.words(fileids=[f])), c
clf = NaiveBayesClassifier.train(list(make_training_data(reader)))
Using my own corpus for category classification in Python NLTK