Skip to main content
QUICK REVIEW

[Paper Review] Predicting the Sentiment Polarity and Rating of Yelp Reviews

Andrew Elkouri|arXiv (Cornell University)|Dec 20, 2015
Sentiment Analysis and Opinion MiningComputer Science1 references3 citations
TL;DR

This paper proposes a text-based classification system for predicting Yelp review sentiment polarity (positive/negative) and 5-star ratings using Naive Bayes, Support Vector Machines, and Logistic Regression. Using only review text with tf-idf feature weighting, Logistic Regression achieved 92.90% accuracy for sentiment polarity and 63.92% for 5-star classification, outperforming other models and demonstrating strong performance with limited features.

ABSTRACT

Online reviews of businesses have become increasingly important in recent years, as customers and even competitors use them to judge the quality of a business. Yelp is one of the most popular websites for users to write such reviews, and it would be useful for them to be able to predict the sentiment or even the star rating of a review. In this paper, we develop two classifiers to perform positive/negative classification and 5-star classification. We use Naive Bayes, Support Vector Machines, and Logistic Regression as models, and achieved the best accuracy with Logistic Regression: 92.90% for positive/negative classification, and 63.92% for 5-star classification. These results demonstrate the quality of the Logistic Regression model using only the text of the review, yet there is a promising opportunity for improvement with more data, more features, and perhaps different models.

Motivation & Objective

  • To predict the sentiment polarity (positive or negative) of Yelp reviews using only the text content.
  • To predict the 5-star rating of Yelp reviews based solely on textual features.
  • To compare the performance of Naive Bayes, Support Vector Machines, and Logistic Regression in both classification tasks.
  • To evaluate the impact of data size and feature engineering on classification accuracy.
  • To identify opportunities for improving 5-star rating prediction through additional features or advanced models.

Proposed method

  • Text preprocessing using scikit-learn's CountVectorizer to clean input, remove stop words, and tokenize words with two or more alphanumeric characters.
  • Feature vector construction via a bag-of-words representation, mapping each unique word to an integer ID and storing counts in a sparse matrix.
  • Application of tf-idf transformation to weight words based on term frequency and inverse document frequency, reducing bias from long reviews and common terms.
  • Sentiment polarity classification: mapping ratings ≥3 to 'positive' and <3 to 'negative'.
  • 5-star classification: using the original star rating (1–5) as the target label.
  • Model training with 70% of data and testing on the remaining 30%, using scikit-learn implementations of Naive Bayes, SVM, and Logistic Regression.

Experimental results

Research questions

  • RQ1Can a text-only classifier accurately predict the sentiment polarity of Yelp reviews?
  • RQ2How well can a classifier predict the exact 5-star rating of a Yelp review using only the review text?
  • RQ3Which machine learning model—Naive Bayes, SVM, or Logistic Regression—performs best on these tasks?
  • RQ4How does increasing training data size affect the performance of the classifiers?
  • RQ5What additional features or model types could improve 5-star rating prediction accuracy?

Key findings

  • Logistic Regression achieved the highest accuracy of 92.90% for sentiment polarity classification, significantly outperforming Naive Bayes (88.54%) and SVM (88.54%).
  • For 5-star classification, Logistic Regression achieved 63.92% accuracy, which is substantially higher than the 46.09% maximum reported by Carbon et al. using Gaussian Discriminant Analysis.
  • Naive Bayes outperformed SVM in sentiment polarity classification by approximately 4 percentage points, contrary to expectations.
  • The performance of Logistic Regression improved with increased training data, indicating a positive data-size correlation.
  • The results suggest that 5-star classification remains challenging due to factors like inconsistent rating behavior and lack of textual support, despite strong performance with text-only features.
  • Future improvements are possible through advanced models like neural networks or by incorporating additional features such as review votes or business attributes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.