Views
No views yet
cardiffnlp/twitter-roberta-base-sentiment-latest.negative / neutral / positive.acidtib/reddit-mood
dataset. Evaluate on your own corpus before relying on it outside the
training domain.| Label | Numeric score | Meaning |
|---|---|---|
negative | 25 | Anywhere on the negative spectrum: complaints, sarcasm, disappointment, balance gripes, bug-report annoyance, scorched-earth rage, personal attacks on devs, quit threats |
neutral | 60 | Factual, banter, parody/hyperbole, in-domain references without strong real-world emotion |
positive | 90 | Genuine positive, hype, love, excitement |
1import { pipeline } from "@huggingface/transformers";
2
3const classify = await pipeline(
4 "text-classification",
5 "acidtib/reddit-mood-classifier",
6 { dtype: "q8" } // load model_quantized.onnx (~25MB, CPU-friendly)
7);
8
9const out = await classify("they nerfed it again, it's over");
10// [{ label: "negative", score: 0.81 }]1from transformers import AutoTokenizer
2import onnxruntime as ort
3
4tokenizer = AutoTokenizer.from_pretrained("acidtib/reddit-mood-classifier")
5session = ort.InferenceSession(
6 "onnx/model_quantized.onnx",
7 providers=["CPUExecutionProvider"],
8)
9# tokenize, run argmax, softmax for confidence.config.json HF model config (id2label, label2id)
tokenizer.json + vocab.json + ... HF tokenizer files (RoBERTa BPE)
onnx/model.onnx full-precision ONNX (~500MB)
onnx/model_quantized.onnx int8 dynamic quantized ONNX (~120MB) -
this is what production inference loads
ort_config.json ONNX Runtime quantization metadata0.7259 on 9612-row corpus.| Label | Test F1 |
|---|---|
| negative | 0.672 |
| neutral | 0.836 |
| positive | 0.669 |
cardiffnlp/twitter-roberta-base-sentiment-latest (RoBERTa-base, 124M params)EarlyStoppingCallback(patience=2) on val macro-F1optimum.onnxruntime