The pipeline
Stage 1 — language detection
Stage 2 — multilingual sentiment
1 · Detected language
2 · Sentiment (multilingual)
Contrast — what an English-only model sees
The classic English-only sentiment model (DistilBERT SST-2) has no idea what non-English words mean. Load it alongside the pipeline and run the same text through both: on English the two mostly agree, but on French, Spanish or Arabic the English-only model collapses — that gap is the whole case for a multilingual model.
Optional stage 3 — English-only contrast (~65 MB)
Multilingual model
English-only model
Why chain them
- Routing: the detected language decides the queue, the reviewer, or the dashboard segment; the sentiment decides the priority.
- Honesty: both stages return full probability distributions, so a low-confidence language detection or a hedged sentiment is visible, not hidden.
- Cost of monolingual: the contrast makes the failure mode concrete — an English-only model doesn't error on French, it just quietly gets it wrong.