Basics · Inside Financial Polarity (82.76 MB WASM q8 · Apache-2.0) · Leave-One-Out Attribution

Inside Financial Polarity: Leave-One-Out Word Attribution & Inversion Pairs

See how mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis weighs every word in context. Dropping one word at a time and re-scoring live (~50 ms/pass) exposes which tokens push polarity positive vs negative — and why swapping costs for revenue flips the sign.

Educational NLP Disclaimer: Word attribution deltas measure sensitivity of this Financial PhraseBank classifier — NOT financial or investment advice.

1. Live Leave-One-Out Word Attribution

Baseline verdict–
Net polarity–
Top bullish token–
Top bearish token–
Live forward passes–
NaN score check–
Total latency–

Token Polarity Heat Tokens (Δ Net Polarity = Net(full) − Net(without word))

Green tokens pushed sentiment positive (removing them lowers Net Polarity); red tokens pushed sentiment negative (removing them raises Net Polarity).

Initialize the model above to compute live Leave-One-Out word attributions.
Per-word Leave-One-Out attribution deltas, without-word class, and impact magnitude
# Word Direction Δ Net Polarity Δ Log-Odds Without Word Verdict
Run Leave-One-Out attribution above to inspect each token.

2. Live Financial Polarity-Inversion Pairs

Same verb, swapped accounting subject: run real live passes on each pair to see DistilRoBERTa invert everyday polarity (costs fell vs revenue fell).

Live polarity inversion pairs comparing cost-side vs revenue-side headlines
Pair Headline A (Side 1) Verdict A & Net Headline B (Side 2) Verdict B & Net Live Flip Δ
Click "Score All 3 Inversion Pairs Live" once the model is ready.

3. Inspect Leave-One-Out Worker & Attribution Math

Show the code · worker.js — attribute() (off-main-thread occlusion passes)
Show the code · fin-news-core.mjs — computeLeaveOneOutAttribution()