# Yelp Polarity

Yelp Polarity is a sentiment classification dataset derived from Yelp reviews, used to train and evaluate machine learning models for binary positive/negative sentiment analysis.

Yelp Polarity is a widely used benchmark dataset for sentiment classification, constructed from reviews of businesses on the Yelp platform. It was introduced in 2015 by Xiang Zhang, Junbo Zhao, and Yann LeCun in their paper "Character-level Convolutional Networks for Text Classification." The dataset consists of 598,000 training samples and 65,000 testing samples, each labeled as either positive (1) or negative (0) sentiment. Reviews with star ratings of 1 or 2 are considered negative, while those with 4 or 5 stars are positive; 3-star reviews are excluded to create a clear binary distinction.

The dataset is derived from the larger Yelp Dataset Challenge, which includes millions of reviews across various business categories. Each sample is a single review text, typically truncated to a maximum length of 1,014 characters in the standard preprocessing. The polarity labels are balanced, with an equal number of positive and negative examples in both training and test sets, making it a straightforward binary classification problem. Yelp Polarity is often paired with its sibling dataset, Yelp Full (which uses 5-class fine-grained labels), and is commonly used alongside other text classification benchmarks like AG News and DBPedia.

## Construction and Preprocessing

The original Yelp reviews were collected over a period from 2004 to 2015, with the dataset released in 2015. The creators applied a simple filtering process: they removed reviews with 3-star ratings and then randomly sampled an equal number of 1-2 star and 4-5 star reviews to ensure balance. The text was lowercased, and punctuation and numbers were preserved, as the focus was on character-level analysis. For the standard version, reviews longer than 1,014 characters were truncated, and shorter ones were padded to that length. This fixed-length representation allows for efficient batching in neural network training.

## Role in Machine Learning Research

Yelp Polarity has become a standard benchmark for evaluating text classification models, particularly those based on [convolutional neural networks](https://www.wikiprompt.org/wiki/convolutional-neural-network) (CNNs) and [recurrent neural networks](https://www.wikiprompt.org/wiki/recurrent-neural-network) (RNNs). The original paper demonstrated that character-level CNNs could achieve high accuracy (around 95%) on this task without any word-level preprocessing, such as tokenization or word embeddings. This finding influenced subsequent research in [deep learning](https://www.wikiprompt.org/wiki/deep-learning) for natural language processing, encouraging exploration of character-based models as an alternative to word-based approaches.

In later years, the dataset has been used to test [transformer](https://www.wikiprompt.org/wiki/transformer)-based models, including [BERT](https://www.wikiprompt.org/wiki/bert) and its variants, which typically achieve accuracy above 97%. It is also a common choice for evaluating [data augmentation](https://www.wikiprompt.org/wiki/data-augmentation) techniques, [model pruning](https://www.wikiprompt.org/wiki/model-pruning) methods, and [transfer learning](https://www.wikiprompt.org/wiki/transfer-learning) strategies. Because the dataset is relatively small compared to modern [large language model](https://www.wikiprompt.org/wiki/large-language-model) training corpora, it serves as a quick and reproducible testbed for new architectures and hyperparameter tuning.

## Comparison with Other Sentiment Datasets

Yelp Polarity is often compared with the [IMDb Reviews](https://www.wikiprompt.org/wiki/imdb-reviews) dataset, which also uses binary sentiment labels but from movie reviews. The key difference is that Yelp reviews are typically shorter, more colloquial, and domain-specific to restaurants and local services, while IMDb reviews are longer and more narrative. This makes Yelp Polarity a more challenging test for models that rely on context, as reviews often contain sarcasm, slang, and domain-specific terms. Another related dataset is the [Amazon Reviews](https://www.wikiprompt.org/wiki/amazon-reviews) polarity, which is constructed similarly but from product reviews. Researchers frequently report results on all three to demonstrate generalization across domains.

## Limitations and Criticisms

One limitation of Yelp Polarity is that it reduces sentiment to a binary positive/negative distinction, ignoring the nuance of neutral or mixed opinions. The exclusion of 3-star reviews means the model never learns to handle ambiguous feedback, which is common in real-world applications. Additionally, the dataset is derived from a single platform, so it may not generalize well to other domains or languages. Some researchers have noted that the character-level truncation can cut off important context at the end of longer reviews, potentially biasing the model. Despite these issues, it remains a popular choice due to its clean labeling, balanced classes, and ease of use.

## Impact and Legacy

The introduction of Yelp Polarity contributed to the broader trend of using large, publicly available datasets to drive progress in [machine learning](https://www.wikiprompt.org/wiki/machine-learning). It has been cited in thousands of research papers and is included in major benchmarking suites such as [GLUE](https://www.wikiprompt.org/wiki/glue-benchmark) and [SuperGLUE](https://www.wikiprompt.org/wiki/superglue) as a downstream task. The dataset also helped popularize the use of character-level features in text classification, which later informed the design of models like [FastText](https://www.wikiprompt.org/wiki/fasttext) and certain [transformer](https://www.wikiprompt.org/wiki/transformer) variants. For practitioners, it remains a go-to resource for prototyping sentiment analysis systems, often used in tutorials and course assignments.

## See Also

- Sentiment analysis
- [Text classification](https://www.wikiprompt.org/wiki/text-classification)
- [Natural language processing](https://www.wikiprompt.org/wiki/natural-language-processing)
- Yelp Dataset

---
Source: https://www.wikiprompt.org/wiki/yelp-polarity
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-09-12T16:28:05.093434+00:00
