Yelp Review Classifier

Yelp Review Classifier

A BERT-base model fine-tuned for 5-class review-rating classification — give it a free-text review and it predicts a rating from 1 to 5 stars (the yelp_review_full label scheme).

Built by Amit Aminov · amitaminov.github.io

Model at a glance

Architecture BertForSequenceClassification — BERT-base (12 layers, hidden 768)
Task Text classification — review rating
Classes 5  (LABEL_0LABEL_4 = 1★…5★, in yelp_review_full order)
Max sequence length 512 tokens
Language English
Fine-tuned from bert-base-cased

Usage

from transformers import pipeline

clf = pipeline("text-classification", model="AmitAminov/yelp_review_classifier")
clf("Incredible food and the service was so warm — we'll be back every week.")
# -> [{'label': 'LABEL_4', 'score': ...}]   # LABEL_4 = 5 stars

The raw labels map to stars as LABEL_0 → 1★, LABEL_1 → 2★, …, LABEL_4 → 5★.

Load the model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tok = AutoTokenizer.from_pretrained("AmitAminov/yelp_review_classifier")
model = AutoModelForSequenceClassification.from_pretrained("AmitAminov/yelp_review_classifier")

Intended use & limitations

  • Intended for rating-style sentiment on English review text (restaurants, businesses, and products with a similar 1–5 register).
  • Labels are the raw LABEL_0…LABEL_4 from training — interpret them as 1–5 stars.
  • Very short snippets, non-review language, or other languages will be less reliable, and — as with any sentiment model — predictions can reflect biases in the training data.

Training

Fine-tuned with the 🤗 Transformers Trainer on the yelp_review_full dataset (5-star reviews). Held-out evaluation metrics were not recorded in this repository; if you need them, re-run evaluation on the yelp_review_full test split.


Part of Amit Aminov's public work.

Downloads last month
58
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for AmitAminov/yelp_review_classifier

Finetuned
(2934)
this model

Dataset used to train AmitAminov/yelp_review_classifier