Downloads · 30 days
14
14% of all-time downloads
Kauhiro/modernbert-yelp-polarity
modernbert-yelp-polarity is a text classification model from Kauhiro. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
Fine-tuned answerdotai/ModernBERT-base on the full Yelp Polarity dataset (560,000 train / 38,000 test reviews) for binary sentiment classification.
Downloads · 30 days
14
14% of all-time downloads
All-time downloads
103
Public
Parameters
150M
598 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors598 MB · 99%
From the Hugging Face model README
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 |
| Metric | Value |
|---|---|
| Accuracy | 1.0000 |
| Precision | 1.0000 |
| Recall | 1.0000 |
| ROC-AUC | 0.9985 |
| 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 |
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}]
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}
}