Skip to content
WebAI

text / classification

Classification

Assigns a label to a span of text — sentiment, topic, intent or policy flags. Encoder models in the 60–130 MB range cover most of it, and they run on WebAssembly without a GPU, which makes classification the cheapest browser AI task to ship.

4 entries

Open demo →

Catalog comparison

Entries include models, tools and applications. An upstream example documents a browser integration, not a test on your device. Missing versions, measurements and licenses remain unverified. Historical estimates are not benchmark results.

Catalog comparison
EntryEntry typeFrameworkResourcesLicenseBrowser evidenceLinks

DistilBERT (SST-2)

Compact BERT variant fine-tuned for binary sentiment classification.

Tasks: Classification

ModelTransformers.js

q8: 64.5 MiB

q4f16: 69.7 MiB

fp16: 127.9 MiB

fp32: 255.5 MiB

Code license: Apache-2.0

Weight license: Apache-2.0

Upstream browser example

Reference ↗

Source review is not a browser execution test.

Sources and comparison details
Exact model ID
Xenova/distilbert-base-uncased-finetuned-sst-2-english
Natural languages
English
Programming languages
Not specified
Other reported capabilities
Not specified
Package
Not verified
Runtime version
@huggingface/transformers@4.3.0
Execution backend
Not verified
Code license
Apache-2.0
Weight license
Apache-2.0
Legacy license label (unverified)
Apache-2.0

Deployment variants

q8
Download size: 64.5 MiB
Peak runtime memory: Not measured
Quantization / precision: q8
Weight revision: 0b6928efcb76139cae2c6881d49cda67fe119f42
Weight artifact ↗
q4f16
Download size: 69.7 MiB
Peak runtime memory: Not measured
Quantization / precision: q4f16
Weight revision: 0b6928efcb76139cae2c6881d49cda67fe119f42
Weight artifact ↗
fp16
Download size: 127.9 MiB
Peak runtime memory: Not measured
Quantization / precision: fp16
Weight revision: 0b6928efcb76139cae2c6881d49cda67fe119f42
Weight artifact ↗
fp32
Download size: 255.5 MiB
Peak runtime memory: Not measured
Quantization / precision: fp32
Weight revision: 0b6928efcb76139cae2c6881d49cda67fe119f42
Weight artifact ↗

Performance and compatibility measurements

Compare only results with the same task, input, hardware, browser and precision. No ranking is inferred from model size.

Not measured

XLM-RoBERTa Base

Multilingual masked language model; used for zero-shot text classification.

Tasks: Classification

ModelTransformers.js

q8: 267.3 MiB

fp16: 531.2 MiB

fp32: 1061.9 MiB

Code license: Apache-2.0

Weight license: MIT

Upstream browser example

Reference ↗

Source review is not a browser execution test.

Sources and comparison details
Exact model ID
Xenova/xlm-roberta-base
Natural languages
100+ languages
Programming languages
Not specified
Other reported capabilities
Not specified
Package
Not verified
Runtime version
@huggingface/transformers@4.3.0
Execution backend
Not verified
Code license
Apache-2.0
Weight license
MIT
Legacy license label (unverified)
MIT

Deployment variants

q8
Download size: 267.3 MiB
Peak runtime memory: Not measured
Quantization / precision: q8
Weight revision: 84bead0eb70f8445a827edba1736f9182c49aab6
Weight artifact ↗
fp16
Download size: 531.2 MiB
Peak runtime memory: Not measured
Quantization / precision: fp16
Weight revision: 84bead0eb70f8445a827edba1736f9182c49aab6
Weight artifact ↗
fp32
Download size: 1061.9 MiB
Peak runtime memory: Not measured
Quantization / precision: fp32
Weight revision: 84bead0eb70f8445a827edba1736f9182c49aab6
Weight artifact ↗

Performance and compatibility measurements

Compare only results with the same task, input, hardware, browser and precision. No ranking is inferred from model size.

Not measured

Toxic-BERT

Detects toxic comments across multiple labels.

Tasks: Classification

ModelTransformers.js

q4f16: 92.7 MiB

q8: 105.6 MiB

fp16: 209.2 MiB

fp32: 417.9 MiB

Code license: Apache-2.0

Weight license: Apache-2.0

Upstream browser example

Reference ↗

Source review is not a browser execution test.

Sources and comparison details
Exact model ID
Xenova/toxic-bert
Natural languages
English
Programming languages
Not specified
Other reported capabilities
Not specified
Package
Not verified
Runtime version
@huggingface/transformers@4.3.0
Execution backend
Not verified
Code license
Apache-2.0
Weight license
Apache-2.0
Legacy license label (unverified)
Apache-2.0

Deployment variants

q4f16
Download size: 92.7 MiB
Peak runtime memory: Not measured
Quantization / precision: q4f16
Weight revision: 65cbc2607cb7fad64f98d1e8a5a3d1f8577895fd
Weight artifact ↗
q8
Download size: 105.6 MiB
Peak runtime memory: Not measured
Quantization / precision: q8
Weight revision: 65cbc2607cb7fad64f98d1e8a5a3d1f8577895fd
Weight artifact ↗
fp16
Download size: 209.2 MiB
Peak runtime memory: Not measured
Quantization / precision: fp16
Weight revision: 65cbc2607cb7fad64f98d1e8a5a3d1f8577895fd
Weight artifact ↗
fp32
Download size: 417.9 MiB
Peak runtime memory: Not measured
Quantization / precision: fp32
Weight revision: 65cbc2607cb7fad64f98d1e8a5a3d1f8577895fd
Weight artifact ↗

Performance and compatibility measurements

Compare only results with the same task, input, hardware, browser and precision. No ranking is inferred from model size.

Not measured

MobileBERT (MNLI)

Compact BERT fine-tuned on MNLI; used for zero-shot text classification in the browser.

Tasks: Classification

ModelTransformers.js

q4f16: 20.0 MiB

q8: 25.7 MiB

fp16: 47.8 MiB

fp32: 94.4 MiB

Code license: Apache-2.0

Weight license: Not verified

Upstream browser example

Reference ↗

Source review is not a browser execution test.

Sources and comparison details
Exact model ID
Xenova/mobilebert-uncased-mnli
Natural languages
English
Programming languages
Not specified
Other reported capabilities
Not specified
Package
Not verified
Runtime version
@huggingface/transformers@4.3.0
Execution backend
Not verified
Code license
Apache-2.0
Weight license
Not verified
Legacy license label (unverified)
Apache-2.0

Deployment variants

q4f16
Download size: 20.0 MiB
Peak runtime memory: Not measured
Quantization / precision: q4f16
Weight revision: 8b0ea66ab7b190bba77418ba03b67d69cfc9a1ee
Weight artifact ↗
q8
Download size: 25.7 MiB
Peak runtime memory: Not measured
Quantization / precision: q8
Weight revision: 8b0ea66ab7b190bba77418ba03b67d69cfc9a1ee
Weight artifact ↗
fp16
Download size: 47.8 MiB
Peak runtime memory: Not measured
Quantization / precision: fp16
Weight revision: 8b0ea66ab7b190bba77418ba03b67d69cfc9a1ee
Weight artifact ↗
fp32
Download size: 94.4 MiB
Peak runtime memory: Not measured
Quantization / precision: fp32
Weight revision: 8b0ea66ab7b190bba77418ba03b67d69cfc9a1ee
Weight artifact ↗

Performance and compatibility measurements

Compare only results with the same task, input, hardware, browser and precision. No ranking is inferred from model size.

Not measured

Application workflows

About Classification

Classification under Text holds 4 catalogue entries: 4 models.

4 of them carry browser evidence, all from upstream browser examples.

The usual pattern for this task is to load quantised weights (ONNX, TFLite or a MediaPipe asset bundle) into the page, hand them to Transformers.js, and accelerate with WebGPU or WebAssembly. What decides the experience is weight size, peak memory and decoding path — not the parameter count.

To see the output first, open the interactive demo for this task: switch models, edit the sample input and compare results on one page. Every demo states whether it is running real weights or a deterministic simulator.

At a glance

Entries
4 in total
Main runtime
Transformers.js
Smallest known weights
20.0 MiB
Browser evidence
4 of 4 verified

Classification: common questions

Can Classification run directly in a browser?
Yes. 4 entries already carry browser evidence (tested here or an upstream example), so the approach works; whether it runs smoothly on your device depends on weight size, browser version and whether WebGPU is enabled.
How large is the model for Classification?
We verified the weight file sizes of 4 entries in this task; the smallest tier is 20.0 MiB. Quantisation differs between entries, so the real download depends on the precision you pick. Files are reused from the HTTP cache or Cache Storage after the first download.
Which devices suit Classification?
Any modern browser with WebAssembly is a starting point, and WebGPU usually makes it faster. Phones are tighter on memory, so run the demo once on the target device before deciding.
Does running a model here upload my data?
The demos on this site infer inside the tab, so inputs never reach a server. Weights and runtimes are fetched from a CDN on first use and then served from the browser cache.

Other tasks in this category

Browse all Text models →