text-classification · text · WASM · ~1.27 GB
Sentiment asks "is this positive?"; stance asks "positive toward what?". Given a claim and a piece of text, this XLM-RoBERTa fact-checking classifier decides whether the text supports or refutes that specific claim — the same sentence flips stance when you change the claim. It's a dedicated stance head (not sentiment, not zero-shot NLI). Set a claim, type some text, and watch the stance meter, all on-device.
| Model | Factiverse/factiverse_stance_detection_ort_quantized |
|---|---|
| Task / pipeline | text-classification (single-label, target-conditioned) |
| Labels | SUPPORTS vs REFUTES; softmax (the two scores sum to 1). Near-50/50 = no clear stance. |
| Architecture | XLM-RoBERTa (multilingual) fine-tuned for fact-checking stance (Factiverse) |
| Input format | claim </s></s> text — claim and text joined by the XLM-R separator |
| Quantization | q8 (8-bit) ONNX (ONNX at repo root — loaded with subfolder: "") |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~1.27 GB, cached after first load — a heavy one-time download; desktop recommended |
| License | Unspecified upstream — research/demo use; base XLM-RoBERTa is MIT |
| Web APIs | WebAssembly, Web Workers — all Baseline widely available |
Set a claim, then type or paste a piece of text. The stance re-computes automatically (debounced) a moment after you stop typing. The meter slides toward supports (right) or refutes (left).
Two numbers, SUPPORTS and REFUTES, that sum to 1 — the model's raw softmax. The
interesting part is the conditioning on the claim: the model reads
claim </s></s> text as one sequence, so the same text can support one claim
and refute another. The button below runs the current text against both the current claim and
its negation, so you can watch the stance flip. When the two bars sit near 50/50, the text doesn't take a clear
side toward that claim — we label that unclear (the model has no separate neutral class).
Stance is the missing axis in text analytics: it's not "is this positive" but "which side of this question is it on". Running it on-device means you can map an argument, triage evidence, or check a source privately, with no round-trip.
Set a claim, score a text live for supports/refutes, and watch the same text flip stance when the claim changes.
Map a debate: drop a claim and a pile of arguments, and auto-sort them into a for / against / unclear board.
Probe the hard cases — sarcasm, implicit stance, off-topic text — and see where a stance model gets fooled.
Contrast stance with sentiment: show how "supports a claim" and "positive tone" are genuinely different axes.
Join the claim and the text with the XLM-R separator and classify the single sequence:
import { pipeline } from "@huggingface/transformers";
const classify = await pipeline(
"text-classification",
"Factiverse/factiverse_stance_detection_ort_quantized",
{ dtype: "q8", subfolder: "" }, // ONNX lives at the repo root
); // downloads + caches ~1.27 GB once
const claim = "Remote work improves productivity.";
const text = "Studies show remote employees finish more tasks.";
const out = await classify(claim + " </s></s> " + text, { top_k: 2 });
// → [{ label: "SUPPORTS", score: 0.99 }, { label: "REFUTES", score: 0.01 }]
Note: this checkpoint's text_pair path returns a degenerate constant, so we build the
claim </s></s> text string ourselves — the verified formulation. It runs in a Web
Worker so the UI never janks.