We implement a naïve Bayes classifier for document classification.
You can directly access the raw IMDB reviews on Andrew Maas' website: http://ai.stanford.edu/~amaas/data/sentiment/. Download this file, unzip it, look at the folders and see how they are organized.