'Train the Naive Bayes classifier on the movie review corpus.'

@requires_nltk_corpus
def train(self):

    super(NaiveBayesAnalyzer, self).train()
    neg_ids = nltk.corpus.movie_reviews.fileids('neg')
    pos_ids = nltk.corpus.movie_reviews.fileids('pos')
    neg_feats = [(self.feature_extractor(nltk.corpus.movie_reviews.words(fileids=[f])), 'neg') for f in neg_ids]
    pos_feats = [(self.feature_extractor(nltk.corpus.movie_reviews.words(fileids=[f])), 'pos') for f in pos_ids]
    train_data = (neg_feats + pos_feats)
    self._classifier = nltk.classify.NaiveBayesClassifier.train(train_data)
