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_0…LABEL_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
28
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
(2924)
this model

Dataset used to train AmitAminov/yelp_review_classifier