โ† All models

text-classification ยท text ยท WASM ยท ~67 MB

Clickbait detection โ€” is this headline baiting you?

"You won't believe what happened next" tells you nothing except that someone wants the click. This DistilBERT headline classifier decides whether a headline is clickbait / manipulative โ€” curiosity gaps, withheld payoffs, emotional bait โ€” or a straight, informative headline that states the news. It's a signal for media-literacy triage, not a truth verdict. Type a headline below and watch the bait meter move, all on-device.

At a glance

ModelCoolpantsMcBadass/headline-classifier
Task / pipelinetext-classification (single-label)
Labelsmanipulative (clickbait) vs legitimate; softmax (the two scores sum to 1)
ArchitectureDistilBERT (uncased, 66M params) fine-tuned for headline manipulation
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~67 MB, cached after first load
LicenseMIT
Web APIsWebAssembly, Web Workers โ€” all Baseline widely available

Run it

Type or paste a headline. The clickbait score re-computes automatically (debounced) a moment after you stop typing. Above 50% the model reads the headline as clickbait / manipulative.

See inside โ€” two competing probabilities

This is the model's raw softmax: two numbers, manipulative and legitimate, that sum to 1. Clickbait has a fuzzy surface signal โ€” the model leans on curiosity-gap patterns it saw in training (withheld payoffs, "you won't believe", list numbers, emotional superlatives), so it's strong on stock bait and genuinely uncertain on punchy-but-real headlines. The chips below the meter highlight cue phrases the UI spotted โ€” a teaching aid, not the model's actual features. When the two bars sit near 50/50, that uncertainty is the finding: treat the score as a triage cue, never a truth label.

Why it matters

Clickbait is the front door of low-quality and manipulative media. A cheap, private, on-device flag lets you screen headlines as they're rendered โ€” in a reader, a feed, a browser extension โ€” without shipping anyone's reading habits to a server.

Use cases

Basics

Type a headline, get a clickbait vs straight verdict live, and compare bait/neutral rewrites of the same story side by side.

Practical

Run a feed of headlines through a bait pre-check and triage them โ€” badge the clickbait as a media-literacy signal, not a verdict.

Wild

Probe the borderline โ€” punchy-but-real headlines, deadpan bait, curiosity gaps that turn out to be honest โ€” and see where the model wavers.

Multi-model

Chain a clickbait flag with sentiment: separate loud emotional bait from calm, negative-but-straight reporting.

How the API works

Binary classification is one call; ask for both scores with top_k:

import { pipeline } from "@huggingface/transformers";

const classify = await pipeline(
  "text-classification",
  "CoolpantsMcBadass/headline-classifier",
  { dtype: "q8" },
); // downloads + caches ~67 MB once

const out = await classify("You won't believe what happened next", { top_k: 2 });
// โ†’ [{ label: "manipulative", score: 0.99 }, { label: "legitimate", score: 0.01 }]

A default problem_type means Transformers.js applies a softmax over the two classes, so manipulative and legitimate sum to 1. It runs in a Web Worker so typing never janks.

References