← All models

text-classification · text · WASM · ~104 MB

Spanish sentiment — a Spanish-native reader of the mood

Most sentiment models are English-first. RoBERTuito is the opposite: a RoBERTa pre-trained on about 500 million Spanish tweets — emoji, hashtags and @-mentions included — then fine-tuned for sentiment. It reads Spanish morphology, diminutives and regional slang as first-class signal and scores text as negativo, neutral or positivo. Type something in Spanish below and watch the real class probabilities; then look inside to see which words moved the verdict. Nothing leaves your device.

At a glance

ModelXenova/robertuito-sentiment-analysis
Base modelpysentimiento/robertuito-sentiment-analysis (RoBERTuito, fine-tuned on TASS)
Task / pipelinetext-classification — three classes: negativo · neutral · positivo
How it worksRoBERTuito encodes the Spanish text, then a small head predicts the 3-class softmax (config id2label: 0 NEG · 1 NEU · 2 POS)
ArchitectureRoBERTa base (~108M params), pre-trained on ~500M Spanish tweets (user/hashtag/emoji tokens), fine-tuned on the TASS sentiment corpus
LanguageSpanish only — a language specialist, not a multilingual model
Quantizationq8 (8-bit) ONNX (model_quantized.onnx)
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~104 MB, cached after first load
LicenseResearch model (pysentimiento) — cite the RoBERTuito / pysentimiento papers
Web APIsWebAssembly, Web Workers — all Baseline widely available

Run it

Type or paste some Spanish, or pick a sample. The verdict updates as you type; the class bars show the full probability split.

See inside — which words moved the verdict

The model never matches "sentiment words" from a list — it reads the whole sentence through one Spanish encoder. To make that legible we run occlusion attribution: re-score the text with each word removed and measure how far the winning class's confidence drops (in log-odds). A word tinted in the verdict colour was pushing that verdict; a grey word was pulling against it. Because the tokenizer decides what a "word" contributes, a diminutive (-ito/-ita), an intensifier or an emoji all carry real weight.

Analyse some text, then explain it to inspect word-level attribution.

Spanish-native vs multilingual

A multilingual model (XLM-R) spreads one embedding space across ~100 languages — brilliant when your text could be in any of them. RoBERTuito goes the other way: all of its ~108M parameters and its entire vocabulary are Spanish, pre-trained on Spanish social text. On idiomatic Spanish — slang, heavy diminutives, code-mixed regional forms — a specialist often reads the register a generalist flattens. The multi-model demo runs both side by side so you can see where they agree and where they part.

Why it matters

Spanish is one of the most-spoken languages on earth, and a lot of opinion data — reviews, DMs, support tickets, social posts — arrives in it. A model that was actually pre-trained on Spanish reads its register, not a translated approximation, and it runs in a tab, so that text never has to leave the device.

Use cases

Basics

Type Spanish, get negativo / neutral / positivo with the full probability split.

Practical

Paste a batch of Spanish reviews and get a sorted, colour-coded monitoring board.

Wild

Break it: regional slang, sarcasm, diminutives and emoji-only messages.

Multi-model

Spanish-native RoBERTuito vs a multilingual XLM-R model on the same text.

How the API works

The pipeline takes a string and returns labelled class scores. Ask for all three with top_k:

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

const clf = await pipeline(
  "text-classification",
  "Xenova/robertuito-sentiment-analysis",
  { dtype: "q8" },
); // downloads + caches ~104 MB once

const out = await clf("Me encanta este lugar 😍", { top_k: 3 });
// → [{ label: "POS", score: 0.98 },
//    { label: "NEU", score: 0.02 },
//    { label: "NEG", score: 0.00 }]

The labels come from the model config (0 NEG · 1 NEU · 2 POS); this page maps them to negativo / neutral / positivo. "See inside" reuses the same loaded instance to re-score occluded variants of the text and read off each word's pull. All of it runs in a Web Worker so the UI never janks.

References