AnkitAI/Sensible-ModernBERT-Sentiment-Analysis
<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ankit-aglawe/parable-assets/main/sensibleheaderdark.png"> <img alt="Sensible" src="https://raw.githubusercontent.com/ankit-aglawe/parable-assets/main/sensible_header.png"> </picture>
๐ฆ Sensible โ ModernBERT Sentiment Analysis
The modern replacement for the classic SST-2 sentiment model โ 0.946 vs 0.913 on the exact same benchmark, one pipeline() line.
from transformers import pipeline
clf = pipeline("text-classification", model="AnkitAI/Sensible-ModernBERT-Sentiment-Analysis")
clf("This movie was absolutely wonderful!")
# [{'label': 'positive', 'score': 0.99}]positive / negative for reviews, comments, feedback, social text. Built on ModernBERT-base โ Flash-Attention-fast, 149M params, CPU-friendly.
Benchmarks
SST-2 official validation set (872 examples) โ the same split every SST-2 model reports on:
+3.3 points over the model most pipelines still default to โ from an encoder released five years later. Training script and raw eval outputs ship in this repo; the reported split was never used for training or checkpoint selection.
Labels
Batch scoring:
texts = ["Best purchase I've made all year.",
"Waited 40 minutes and the order was still wrong."]
for t, r in zip(texts, clf(texts, batch_size=64)):
print(f"{r['label']:<9} {r['score']:.2f} {t}")Built for
- Product & review analytics โ score feedback streams at scale
- Social/comment moderation dashboards โ fast, CPU-deployable
- Drop-in upgrade โ same task and label semantics as the distilbert-sst2 default your stack probably uses
Good to know
- Two classes only (no neutral) โ SST-2 convention; genuinely neutral text gets forced to a side
- English, sentence/short-paragraph level
- Trained on movie-review sentences (SST-2); transfers well to general reviews/comments, less so to domain jargon โ for financial text use FinSense
Training details
Full fine-tune of ModernBERT-base on SST-2 (GLUE, 67k sentences): 2 epochs, lr 2e-5, batch 32, fp32, best checkpoint by held-back 5% of train โ the official validation set stayed untouched until final reporting.
Support the Project
If this model is useful in your work, you can support independent research:
<p align="left"> <a href="https://www.buymeacoffee.com/AnkitAI" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me a Coffee" height="60" width="217" /></a> </p>
Citation
@misc{sensiblesentiment2026,
author = {Aglawe, Ankit},
title = {Sensible: ModernBERT Sentiment Analysis},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/AnkitAI/Sensible-ModernBERT-Sentiment-Analysis}
}Base & license
Apache-2.0 (ModernBERT-base, Answer.AI). Trained on SST-2 (Socher et al., 2013 / GLUE).
More from AnkitAI
Version history
- v1 (2026-07-20) โ initial release: ModernBERT-base, SST-2, seed 42.
More on the Sensible models: ankitaglawe.com/sensible
