1. Interactive 2,271-Label IAB Taxonomy Tagger
Choose an editorial sample, edit the copy below, paste from clipboard, or load a text file:
1 / (1 + e−z) over all 2,271 logits (never softmax), stripping fixed-128 [PAD] tokens for production parity.
IAB Content Taxonomy 3.0
704 labels · indices 0–703Download or initialise the local model above, then classify text to inspect Content 3.0 tags.
IAB Audience Taxonomy 1.1
1,567 labels · Interest · Purchase Intent · DemographicAudience segments and full taxonomy hierarchy paths appear here after classification.
zgpu-ai/zlm-v1-iab-classify-edge
2. See Inside — 2,271-Logit Sigmoid Distribution & Token Window
Unlike single-label softmax classifiers that force scores to sum to 100%, multi-label sigmoid scores each of the
2,271 IAB categories independently. Almost all labels sit near 0.0 while a sparse cluster of
matching categories rises above the active threshold (τ).
Log-Scaled Probability Distribution
10 bins · log₁₀ countWordPiece Token Window
Uncased BERT · 30,522 vocabRun classification to inspect the exact uncased WordPiece tokens fed into ONNX Runtime.
3. Why On-Device IAB Taxonomy Matters
- Zero-server contextual intelligence: Classify page copy into closed, valid IAB Content 3.0 & Audience 1.1 identifiers directly inside a browser or edge worker without transmitting page content to a third-party LLM API.
- Guaranteed taxonomy validity: Because the output head is fixed to 2,271 canonical IAB labels, it never hallucinates out-of-taxonomy strings (unlike prompted LLMs).
- Sub-15 ms warm latency at 25.73 MB: Small enough to cache locally via Cache Storage and run interactively on every edit, draft revision, or editorial CMS save.
Use-Case Ladder
4. How the API Works & Code Inspection
import { AutoModelForSequenceClassification, AutoTokenizer, Tensor } from "@huggingface/transformers";
const repo = "zgpu-ai/zlm-v1-iab-classify-edge";
const tokenizer = await AutoTokenizer.from_pretrained(repo);
const model = await AutoModelForSequenceClassification.from_pretrained(repo, { device: "wasm", dtype: "q8" });
// Unpadded single-text encoding preserving closing [SEP] within the 128-token serving window
const enc = tokenizer(text, { padding: false, truncation: false });
let ids = Array.from(enc.input_ids.data, Number).filter((id) => id !== 0);
if (ids.length > 128) ids = [...ids.slice(0, 127), 102];
const toInt64 = (a) => new Tensor("int64", BigInt64Array.from(a, BigInt), [1, a.length]);
const { logits } = await model({
input_ids: toInt64(ids),
attention_mask: toInt64(ids.map(() => 1)),
token_type_ids: toInt64(ids.map(() => 0)),
});
// Multi-label sigmoid (never softmax) across 704 Content + 1,567 Audience logits
const probs = Array.from(logits.data, (z) => 1 / (1 + Math.exp(-z)));