Classical ML · CPU-only · Self-hostable

Sentiment analysis that stays cheap at scale

A TF-IDF + logistic-regression classifier that labels short English text positive or negative, with a confidence score, in the time an LLM spends warming up. Built in 2024, kept alive for the one job large models still make expensive: classifying a very large amount of very short text.

2 classes + confidence No GPU, no queue Nothing stored One POST request

English, review-length works best. Separate several texts with (semicolon + space) to score them in one request.

0 / 4000 · /Ctrl + Enter

Prediction

Your result will appear here.

Analyzing…

Running the model…

Positive
Confidence

Confidence is the model's probability for the class it chose — not a guarantee.

Why a small model still earns its keep

Any general-purpose model can label sentiment now, and it will read sarcasm, negation and mixed opinions better than a bag-of-words classifier ever will. That is simply true. What has not changed is what happens when you point it at ten million support tickets.

Cost that doesn't track volume

No per-token meter. A month of classification costs whatever the CPU it runs on costs — the same whether you send a thousand rows or ten million.

Fast enough for the request path

A vector transform and a dot product. It finishes before a hosted model has streamed its first token, so you can score inline instead of in a nightly batch.

Runs where your data already is

Two pickle files and a Django view. Deploy it inside your own network and customer text never crosses a vendor boundary — often the real blocker, not accuracy.

Deterministic and auditable

Same input, same label, same probability, every single time. No temperature, no prompt drift, no vendor silently swapping the model under you.

Where it loses — worth saying out loud

This model is binary, English-only, and trained on short social-media style text. It has no notion of neutral, it misreads sarcasm, it can trip on negation, and a sentence that praises the camera while trashing the battery gets flattened into one label. Long documents dilute it.

The pattern that actually works in 2026: run this first-pass over everything, then route only the low-confidence and clearly-mixed cases to a large model. You keep the nuance where it matters and pay for it on maybe five percent of your traffic.

One endpoint, no SDK

POST a form field called comment. Get back a label, a confidence string and the text you sent. There is no key to rotate, no client library to install and no JSON schema to learn.

curl -X POST https://sentiment.thesarwar.site/sentml/ \
  --data-urlencode "comment=great camera and superb battery"
const body = new URLSearchParams();
body.append("comment", "great camera and superb battery");

const res = await fetch("https://sentiment.thesarwar.site/sentml/", {
  method: "POST",
  body,
});
const data = await res.json();
// data.sentiment[0] -> [text, 1, "93.91%"]
import requests

r = requests.post(
    "https://sentiment.thesarwar.site/sentml/",
    data={"comment": "great camera and superb battery"},
    timeout=10,
)
text, label, confidence = r.json()["sentiment"][0]
# label: 1 = positive, 0 = negative

Endpoints

POST /sentml/ JSON API — returns the prediction as JSON.
POST / Same model, used by the analyzer on this page.
GET / This page.

No key, no rate limiter — one server pays for it, so be reasonable. If you need guaranteed throughput, self-host it or ask me for a dedicated instance.

Response

{
  "sentiment": [
    ["great camera and superb battery", 1, "93.91%"]
  ],
  "time": 0.002
}
  • sentiment — one triple per text: the text, the label (1 positive / 0 negative) and the confidence.
  • time — server-side timing for the call.
  • Batch by joining texts with — you get one triple back per text, in order.
  • CORS is open, so the browser can call it directly. Nothing you send is written to disk.

Pricing

When this went up, a hosted sentiment API was worth charging for. It isn't anymore — a general-purpose model will do the same job in one line of prompt, and pretending otherwise would be selling you something you can get for free. So the honest version: the model is free, and the work around it is what costs money.

Paid work
Scoped per project

For when the free model isn't quite your model.

  • Retraining on your data — your domain's vocabulary, your label set, including a neutral class or aspect-level labels.
  • Deployment inside your infrastructure — Docker, autoscaling, monitoring, dedicated throughput.
  • Hybrid routing — this model as the cheap first pass, an LLM for the uncertain tail, with the threshold tuned on your data.
  • Evaluation — an honest measurement of whether a small model is enough for your use case, before you commit to a bill.

Tell me what you're classifying and how much of it there is — sarwar.me. If a small model is the wrong tool for your problem, I'll say so.