ModernBERT β Yelp Polarity Sentiment Classifier
Fine-tuned answerdotai/ModernBERT-base on the full Yelp Polarity dataset (560,000 train / 38,000 test reviews) for binary sentiment classification.
| Label | Meaning |
|---|---|
negative (0) |
1β2 star reviews |
positive (1) |
3β4 star reviews |
Evaluation results (test set, 38,000 samples)
| Metric | Value |
|---|---|
| Accuracy | 1.0000 |
| Precision | 1.0000 |
| Recall | 1.0000 |
| ROC-AUC | 0.9985 |
Training details
| Parameter | Value |
|---|---|
| Base model | answerdotai/ModernBERT-base |
| Epochs | 3 |
| Batch size (effective) | 32 (16 Γ grad_accum 2) |
| Learning rate | 2e-5 |
| LR scheduler | cosine |
| Warmup ratio | 0.06 |
| Weight decay | 0.01 |
| Max length | 512 |
| Precision | fp16 |
| Early stopping patience | 2 |
Usage
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Kauhiro/modernbert-yelp-polarity",
)
result = classifier("The food was absolutely amazing and the service was top notch!")
print(result)
# [{'label': 'positive', 'score': 0.9997}]
Citation
If you use this model, please cite:
@misc{modernbert-yelp-polarity,
author = {Kauhiro},
title = {ModernBERT fine-tuned on Yelp Polarity},
year = {2025},
url = {https://huggingface.co/Kauhiro/modernbert-yelp-polarity}
}
- Downloads last month
- 46
Model tree for Kauhiro/modernbert-yelp-polarity
Base model
answerdotai/ModernBERT-baseDataset used to train Kauhiro/modernbert-yelp-polarity
Space using Kauhiro/modernbert-yelp-polarity 1
Evaluation results
- accuracy on Yelp Polaritytest set self-reported1.000
- f1 on Yelp Polaritytest set self-reported1.000
- roc_auc on Yelp Polaritytest set self-reported0.999