CoolFace
Modelpublic

AnkitAI/Sensible-ModernBERT-Sentiment-Analysis

sourceHugging Faceapache-2.0updated 3d agoView on Hugging Face
1likes43downloads
README.md129 linesDownload Raw Back to root
1---2base_model: answerdotai/ModernBERT-base3base_model_relation: finetune4datasets:5- nyu-mll/glue6license: apache-2.07language:8- en9pipeline_tag: text-classification10library_name: transformers11widget:12- text: This movie was absolutely wonderful, a joy from start to finish.13- text: The plot was a mess and the acting felt phoned in.14- text: Support resolved my issue in minutes โ€” genuinely impressed.15tags:16- sentiment-analysis17- sentiment18- text-classification19- sst-220- sst221- modernbert22- reviews23- english24- positive-negative25- distilbert-sst2-alternative26---27 28<picture>29  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ankit-aglawe/parable-assets/main/sensible_header_dark.png">30  <img alt="Sensible" src="https://raw.githubusercontent.com/ankit-aglawe/parable-assets/main/sensible_header.png">31</picture>32 33# ๐Ÿฆ‰ Sensible โ€” ModernBERT Sentiment Analysis34 35### The modern replacement for the classic SST-2 sentiment model โ€” **0.946 vs 0.913** on the exact same benchmark, one `pipeline()` line.36 37```python38from transformers import pipeline39 40clf = pipeline("text-classification", model="AnkitAI/Sensible-ModernBERT-Sentiment-Analysis")41clf("This movie was absolutely wonderful!")42# [{'label': 'positive', 'score': 0.99}]43```44 45**positive / negative** for reviews, comments, feedback, social text. Built on [ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) โ€” Flash-Attention-fast, 149M params, CPU-friendly.46 47---48 49## Benchmarks50 51SST-2 official validation set (872 examples) โ€” the same split every SST-2 model reports on:52 53| Model | Accuracy |54|---|---|55| ๐Ÿ’ฌ **This model** | **0.9461** |56| distilbert-base-uncased-finetuned-sst-2-english (the 3.9M-downloads/month default) | 0.9130 |57 58**+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.59 60## Labels61 62| id | label |63|---|---|64| 0 | negative |65| 1 | positive |66 67**Batch scoring:**68 69```python70texts = ["Best purchase I've made all year.",71         "Waited 40 minutes and the order was still wrong."]72for t, r in zip(texts, clf(texts, batch_size=64)):73    print(f"{r['label']:<9} {r['score']:.2f}  {t}")74```75 76## Built for77 78- **Product & review analytics** โ€” score feedback streams at scale79- **Social/comment moderation dashboards** โ€” fast, CPU-deployable80- **Drop-in upgrade** โ€” same task and label semantics as the distilbert-sst2 default your stack probably uses81 82## Good to know83 84- Two classes only (no neutral) โ€” SST-2 convention; genuinely neutral text gets forced to a side85- English, sentence/short-paragraph level86- Trained on movie-review sentences (SST-2); transfers well to general reviews/comments, less so to domain jargon โ€” for financial text use [FinSense](https://huggingface.co/AnkitAI/FinSense-ModernBERT-Financial-News-Sentiment-Analysis)87 88## Training details89 90Full 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.91 92## Support the Project93 94If this model is useful in your work, you can support independent research:95 96<p align="left">97  <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>98</p>99 100## Citation101 102```bibtex103@misc{sensiblesentiment2026,104  author = {Aglawe, Ankit},105  title = {Sensible: ModernBERT Sentiment Analysis},106  year = {2026},107  publisher = {Hugging Face},108  url = {https://huggingface.co/AnkitAI/Sensible-ModernBERT-Sentiment-Analysis}109}110```111 112## Base & license113 114**Apache-2.0** ([ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base), Answer.AI). Trained on [SST-2](https://huggingface.co/datasets/nyu-mll/glue) (Socher et al., 2013 / GLUE).115 116## More from AnkitAI117 118| Model | Task | Score |119|---|---|---|120| [FinSense ModernBERT](https://huggingface.co/AnkitAI/FinSense-ModernBERT-Financial-News-Sentiment-Analysis) | financial news sentiment (3-class) | 0.8675 |121| [FinSense distilbert v2](https://huggingface.co/AnkitAI/distilbert-base-uncased-financial-news-sentiment-analysis) | financial news sentiment, tiny | 0.8447 |122| [Parable](https://huggingface.co/collections/AnkitAI/parable-6a4fac60f4b35afca3019621) | local agent LLMs (GGUF) | โ€” |123 124## Version history125 126- **v1** (2026-07-20) โ€” initial release: ModernBERT-base, SST-2, seed 42.127 128More on the Sensible models: [ankitaglawe.com/sensible](https://ankitaglawe.com/sensible)129