mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis
Xenova/distilroberta-finetuned-financial-news-sentiment-analysis
text-classification
sentences_allagree). It is an educational
NLP demonstration only — NOT financial, trading, or investment advice.
1. Live Earnings & Market Headline Sentiment Inspector
Choose a synthetic market headline preset, drag & drop or paste (Ctrl/Cmd+V) text, or type your own:
.txt, .csv, .json, or .md file here, or press
Ctrl/Cmd+V anywhere on the page. Everything executes locally in a Web Worker.
3-Class Financial Probability Distribution
Signal Breakdown & Polarity Interpretation
P(positive) − P(negative). Shannon entropy measures uncertainty
across all 3 PhraseBank classes (max 1.585 bits).
2. Why DistilRoBERTa Financial Sentiment Differs from SST-2 & FinBERT
Generic SST-2 models are trained on movie reviews with only 2 classes (no neutral) and read
“declined” or “narrowed” as bad. Full 12-layer FinBERT captures financial tone at ~111 MB,
whereas 6-layer DistilRoBERTa keeps 98.23% sentences_allagree accuracy in a
82.76 MB q8 WASM footprint (~56 ms per headline) with a clean Apache-2.0 license.
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";
const classifier = await pipeline(
"text-classification",
"Xenova/distilroberta-finetuned-financial-news-sentiment-analysis",
{ device: "wasm", dtype: "q8" }
);
const scores = await classifier("Operating costs declined 12% year-over-year.", { top_k: 3 });