text-classification Ā· 110.72 MB WASM q8 Ā· 12-Layer BERT (bert-base-uncased) Ā· CC-BY-NC-SA-4.0

ProsusAI FinBERT — 12-Layer Financial Sentiment

ProsusAI/finbert (served via Xenova/finbert , CC-BY-NC-SA-4.0) is the canonical 12-layer BERT-base financial NLP classifier (~110M params, 110.72 MB quantized q8 ONNX on CPU WASM) fine-tuned on Financial PhraseBank to score positive, negative, and neutral market tone entirely on-device.

Upstream Model ProsusAI/finbert
ONNX Artifact Xenova/finbert
Pipeline Task text-classification
Size & Quant 110.72 MB Ā· WASM q8
Classes (id2label) 0:positive Ā· 1:negative Ā· 2:neutral
License CC-BY-NC-SA-4.0 (Non-Commercial)
Educational NLP & Non-Commercial License Notice: ProsusAI/finbert is licensed under CC-BY-NC-SA-4.0 (non-commercial, share-alike). Scores reflect Financial PhraseBank linguistic tone only — NOT financial, trading, or investment advice.

1. Live FinBERT Sentiment & Raw Logit Inspector

Select a financial headline or earnings excerpt, drag & drop or paste (Ctrl/Cmd+V) text, or type your own:

Drop a .txt, .csv, .json, or .md file here, or press Ctrl/Cmd+V anywhere on the page. Inference runs locally in a Web Worker.
Inference latency–
Net Polarity–
Logit Margin (z₁ āˆ’ zā‚‚)–
Shannon entropy–
WordPiece tokens–
Lexicon Drift–
NaN score check–
Backend / dtypeWASM Ā· q8

3-Class FinBERT Probability Distribution

Awaiting inference
Initialize the model above to compute live class probabilities.

Raw Logits, Lexicon Drift & Signal Notes

Unnormalized logits follow config.id2label: 0: positive, 1: negative, 2: neutral.

See Inside: BERT Uncased WordPiece Tokens (30,522 vocab Ā· do_lower_case: true)

Score a headline above to inspect [CLS], WordPiece ## splits, and [SEP] tokens.

2. Architecture & How the Transformers.js API Works

Pre-trained by ProsusAI on the Reuters TRC2-financial corpus and fine-tuned on Malo et al.’s Financial PhraseBank, FinBERT uses a full 12-layer BERT encoder (bert-base-uncased) instead of a 6-layer distilled student — preserving deeper syntactic context for long SEC and earnings prose.

import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";

const classifier = await pipeline("text-classification", "Xenova/finbert", {
  device: "wasm",
  dtype: "q8",
});
const scores = await classifier("Stocks rallied and the British pound gained.", { top_k: 3 });
Show the code Ā· worker.js — runSingleClassify() (110.72 MB q8 WASM worker)
Show the code Ā· finbert-core.mjs — normalizeScores() (exact id2label + logits + NaN check)