Small, CPU-friendly models and datasets for English sentiment and embeddings — nothing here needs a GPU.
| Repo | Task | Size | License |
|---|---|---|---|
| distilbert-sst2-sentiment | Binary sentiment classification | 268 MB | Apache-2.0 |
| all-MiniLM-L6-v2 | Sentence embeddings, 384-d | 92 MB | Apache-2.0 |
| bert-tiny | 4.4M-param encoder for CI & edge | 17 MB | MIT |
| Repo | Task | Rows | License |
|---|---|---|---|
| rotten-tomatoes-sentiment | Binary sentiment | 10,662 | research use |
| go-emotions-simplified | Multi-label emotion, 28 classes | 54,263 | Apache-2.0 |
The pieces are chosen to fit together. Classify sentiment, then score it on matching data — this run reproduces 89.7% on the first 300 test rows:
from transformers import pipeline
from datasets import load_dataset
clf = pipeline("sentiment-analysis", model="priyaganesh2050/distilbert-sst2-sentiment")
test = load_dataset("priyaganesh2050/rotten-tomatoes-sentiment", split="test")
sample = test.select(range(300))
pred = [1 if r["label"] == "POSITIVE" else 0 for r in clf(sample["text"], batch_size=32)]
acc = sum(p == g for p, g in zip(pred, sample["label"])) / len(pred)
print(f"accuracy: {acc:.3f}") # 0.897
Semantic search over the same reviews, on CPU:
from sentence_transformers import SentenceTransformer
enc = SentenceTransformer("priyaganesh2050/all-MiniLM-L6-v2")
corpus = enc.encode(test["text"][:2000], normalize_embeddings=True)
query = enc.encode("beautifully shot but boring", normalize_embeddings=True)
for i in (corpus @ query).argsort()[-5:][::-1]:
print(round(float(corpus[i] @ query), 3), test["text"][i][:80])
Need something small enough to fine-tune inside a CI job? bert-tiny is 17 MB
and trains on the Rotten Tomatoes split in under a minute on a laptop CPU.
distilbert-sst2-sentiment
has no neutral class and will confidently assign a side to factual or mixed text. When the
margin between classes is small, read it as undecided. For finer affect, train on
go-emotions-simplified.neutral, approval
and admiration dominate while grief and pride have a few
hundred examples. Use macro-F1 and per-class scores; plain accuracy looks great and means
nothing.all-MiniLM-L6-v2 truncates silently
past 256 word pieces — chunk long documents before embedding.