cardiffnlp_twitter-xlm-roberta-base-sentiment
cardiffnlp · View on Hugging Face ↗
Model card
The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.
language: multilingual widget:
- text: "🤗"
- text: "T'estimo! ❤️"
- text: "I love you!"
- text: "I hate you 🤮"
- text: "Mahal kita!"
- text: "사랑해!"
- text: "난 너가 싫어"
- text: "😍😍😍"
twitter-XLM-roBERTa-base for Sentiment Analysis
This is a multilingual XLM-roBERTa-base model trained on ~198M tweets and finetuned for sentiment analysis. The sentiment fine-tuning was done on 8 languages (Ar, En, Fr, De, Hi, It, Sp, Pt) but it can be used for more languages (see paper for details).
- Paper: XLM-T: A Multilingual Language Model Toolkit for Twitter.
- Git Repo: XLM-T official repository.
This model has been integrated into the TweetNLP library.
Example Pipeline
from transformers import pipeline
model_path = "cardiffnlp/twitter-xlm-roberta-base-sentiment"
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("T'estimo!")
[{'label': 'Positive', 'score': 0.6600581407546997}]
Full classification example
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
from scipy.special import softmax
# Preprocess text (username and link placeholders)
def preprocess(text):
new_text = []
for t in text.split(" "):
t = '@user' if t.startswith('@') and len(t) > 1 else t
t = 'http' if t.startswith('http') else t
new_text.append(t)
return " ".join(new_text)
MODEL = f"cardiffnlp/twitter-xlm-roberta-base-sentiment"
tokenizer = AutoTokenizer.from_pretrained(MODEL)
config = AutoConfig.from_pretrained(MODEL)
# PT
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
model.save_pretrained(MODEL)
text = "Good night 😊"
text = preprocess(text)
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
scores = output[0][0].detach().numpy()
scores = softmax(scores)
# # TF
# model = TFAutoModelForSequenceClassification.from_pretrained(MODEL)
# model.save_pretrained(MODEL)
# text = "Good night 😊"
# encoded_input = tokenizer(text, return_tensors='tf')
# output = model(encoded_input)
# scores = output[0][0].numpy()
# scores = softmax(scores)
# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
for i in range(scores.shape[0]):
l = config.id2label[ranking[i]]
s = scores[ranking[i]]
print(f"{i+1}) {l} {np.round(float(s), 4)}")
Output:
1) Positive 0.7673
2) Neutral 0.2015
3) Negative 0.0313
Reference
@inproceedings{barbieri-etal-2022-xlm,
title = "{XLM}-{T}: Multilingual Language Models in {T}witter for Sentiment Analysis and Beyond",
author = "Barbieri, Francesco and
Espinosa Anke, Luis and
Camacho-Collados, Jose",
booktitle = "Proceedings of the Thirteenth Language Resources and Evaluation Conference",
month = jun,
year = "2022",
address = "Marseille, France",
publisher = "European Language Resources Association",
url = "https://aclanthology.org/2022.lrec-1.27",
pages = "258--266"
}
Magnet link
Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:
magnet:?xt=urn:btih:b6bde4d5a52c6091d0da1db0d6cf308a88dcb54f&dn=cardiffnlp_twitter-xlm-roberta-base-sentimentOpen magnet in torrent client · infohash b6bde4d5a52c6091d0da1db0d6cf308a88dcb54f
Files & hashes
| Path | Size | sha1 | sha256 |
|---|---|---|---|
| README.md | 3.2 KB (3,290 B) | b37b011294a2b67c03d02d87e9dc7d1b73579e9c | e68315c0998946dc12ab17e7b54911871e5adf379f3169760961d2f4a75f9f42 |
| config.json | 841 B (841 B) | 312355cb9d60690ace3ad8fe687a35626399e043 | daeb7bd985217b249d89aaaa3fd589b3846e003d8d29d75fb78f0bd892609b41 |
| pytorch_model.bin | 1.04 GB (1,112,271,561 B) | 79cd65b0a96245df0e8cd2cfe862031e77bb99b3 | 93316a86051c359748c5d5453e7660c69a21a57cfb477892f95f539e3e171196 |
| sentencepiece.bpe.model | 4.8 MB (5,069,051 B) | 7e88c49faff6c6c136fdf4a3402d0cb534c6ab10 | cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865 |
| special_tokens_map.json | 150 B (150 B) | 6cd1d9021e10d47aed59399af6b0e30312b46ca4 | 7638f5bbbe86ef6d604ef28ad3647dc690d6d117c81c0d63e885416be8da1150 |
Cite this release
- Canonical URL
- https://aiseedbank.org/models/cardiffnlp_twitter-xlm-roberta-base-sentiment/
- Slug
- cardiffnlp_twitter-xlm-roberta-base-sentiment
- Infohash
- b6bde4d5a52c6091d0da1db0d6cf308a88dcb54f
- License
- no license recorded
- Signing key fingerprint
- 85a3b32c3712427b
Every file carries a locally computed sha256 — verify a download against the signed sums: cardiffnlp_twitter-xlm-roberta-base-sentiment.SHA256SUMS (+ minisign signature).
Provenance
| Upstream repository | cardiffnlp/twitter-xlm-roberta-base-sentiment |
|---|---|
| Revision (pinned) | f2f1202b1bdeb07342385c3f807f9c07cd8f5cf8 |
| Fetched at | 2026-09-03T21:11:31Z |
| License at fetch | no license recorded |
| Snapshot tool | huggingface · seedbank 0.1.0 |
Trackers
- udp://announce.aitorrent.org:6969/announce
- http://announce.aitorrent.org:7070/announce
- udp://announce2.aitorrent.org:6970/announce
- http://announce2.aitorrent.org:7071/announce
- udp://tracker.opentrackr.org:1337/announce
- udp://open.demonii.com:1337/announce
- udp://open.stealth.si:80/announce
- udp://exodus.desync.com:6969/announce
- udp://tracker.torrent.eu.org:451/announce
✓ verified · rehash-vs-hf-metadata at 2026-09-03T21:11:43Z
no license recorded1.04 GB (1,117,344,893 bytes)transformerspytorchxlm-robertatext-classificationmultilingualendpoints_compatible1 language (tf)paper: 2104.12250