Instructions to use AnkitAI/Sensible-ModernBERT-Sentiment-Analysis with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnkitAI/Sensible-ModernBERT-Sentiment-Analysis with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AnkitAI/Sensible-ModernBERT-Sentiment-Analysis")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AnkitAI/Sensible-ModernBERT-Sentiment-Analysis") model = AutoModelForSequenceClassification.from_pretrained("AnkitAI/Sensible-ModernBERT-Sentiment-Analysis", device_map="auto") - Notebooks
- Google Colab
- Kaggle
🦉 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:
| Model | Accuracy |
|---|---|
| 💬 This model | 0.9461 |
| distilbert-base-uncased-finetuned-sst-2-english (the 3.9M-downloads/month default) | 0.9130 |
+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
| id | label |
|---|---|
| 0 | negative |
| 1 | positive |
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.
📖 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
| Model | Task | Score |
|---|---|---|
| FinSense ModernBERT | financial news sentiment (3-class) | 0.8675 |
| FinSense distilbert v2 | financial news sentiment, tiny | 0.8447 |
| Parable | local agent LLMs (GGUF) | — |
🗂 Version history
- v1 (2026-07-20) — initial release: ModernBERT-base, SST-2, seed 42.
- Downloads last month
- 2
Model tree for AnkitAI/Sensible-ModernBERT-Sentiment-Analysis
Base model
answerdotai/ModernBERT-base