Sentiment analysis determines whether text expresses a positive or negative opinion. As a classification task, it predicts a category rather than a number. section 5.0 section 6.4
A review classifier can be built by turning text into word features and training a model:
- Represent each review as a dictionary of words and their counts. section 6.4
- Train a logistic classifier with the word counts as features and sentiment as the target. section 6.4
- Inspect the learned word weights to see which words contribute to the model. section 6.4
Classifying movie reviews
An IMDB dataset pairs review text with positive or negative labels. A review containing “comfortable” contributes a positive coefficient in the example model. section 6.4











