Basics · 5-Star Ordinal Calibration & Temperature Scaling · 171.16 MB WASM q8 · MIT

5-Star Ordinal Calibration: Expected Rating E[S] vs Argmax & Temperature

Because nlptown/bert-base-multilingual-uncased-sentiment (MIT) outputs a full 5-star probability vector, expected rating (E[S] = Σ k·P(k)) and spread (σ) distinguish genuinely lukewarm 3-star reviews from polarized mixed reviews — across all six training languages.

1. Cross-Lingual & Unimodal vs Bimodal Star Calibration

Mean E[S] Rating–
Mean Top Conf–
Mean Spread σ–
Mean 5-Way Entropy–
High-Spread / Mixed–
6-Pass Latency / NaN–

Stacked 5-Star Probability Distribution (1★ → 5★)

Initialize the model above to plot live 5-star probability stacks.
5-star probabilities, expected rating E[S], spread sigma, raw logit margin, and entropy across six reviews
Group Target Argmax Star E[S] · σ Margin / Entropy Review Text
Run the 6-review calibration suite above.

2. Raw Softmax vs Temperature Scaling & Uncased Folding Check

Inspect unnormalized raw logits [z₁ … z₅], adjust softmax temperature (T = 0.50 … 2.50) client-side without re-running inference, and verify that do_lower_case: true keeps uppercase reviews identical in logits to lowercase text.

Raw E[S] → Scaled E[S]–
Top-2 Logit Margin–
Raw Entropy–
Scaled Entropy (T)–
WordPiece Tokens–
UPPERCASE Drift–

Raw Model Softmax (T = 1.00)

Run raw logit inspection above.

Temperature-Scaled Calibration (T = 1.00)

Adjust temperature slider after inspection to calibrate confidence.

3. Inspect Temperature Softmax & Raw Logit Helpers

Show the code · nlptown-core.mjs — softmaxLogits()
Show the code · nlptown-core.mjs — computeLogitStats()