Understanding data format
An interesting dataset, Movie Review Data from Rotten Tomatoes (http://www.cs.cornell.edu/people/pabo/movie-review-data/), was used in this case. Half of the reviews are positive, the other half negative, and there are about 10,000 sentences in total. There are around 20,000 different words in the vocabulary. The dataset is stored in the data folder.
It contains two files: one, rt-polarity.neg, contains all the negative sentences, and another, rt-polarity.pos, contains only positive sentences. To perform classification, we need to associate them with the labels. Each positive sentence is associated with a one-hot encoded label, [0, 1], and each negative sentence is associated with [1, 0], as shown in the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access