title: Implementing Bag-of-Words Naive-Bayes classifier in NLTK
body: <p>I basically have the <a href="https://stackoverflow.com/questions/2162718/python-nltk-code-snippet-to-train-a-classifier-naive-bayes-using-feature-frequ">same question as this guy</a>.. The <a href="http://nltk.googlecode.com/svn/trunk/doc/book/ch06.html#document-classify-all-words" rel="nofollow noreferrer">example in the NLTK book</a> for the Naive Bayes classifier considers only whether a word occurs in a document as a feature.. it doesn't consider the frequency of the words as the feature to look at ("bag-of-words").</p>
  
  <p><a href="https://stackoverflow.com/a/2226115/378622">One of the answers</a> seems to suggest this can't be done with the built in NLTK classifiers.  Is that the case?  How can I do frequency/bag-of-words NB classification with NLTK?</p>