AI SeedbankHelp preserve open and free AI for humanity's future

← All models

cardiffnlp_twitter-xlm-roberta-base-sentiment

cardiffnlp · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

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-sentiment

Open magnet in torrent client · infohash b6bde4d5a52c6091d0da1db0d6cf308a88dcb54f

Files & hashes

PathSizesha1sha256
README.md3.2 KB (3,290 B)b37b011294a2b67c03d02d87e9dc7d1b73579e9ce68315c0998946dc12ab17e7b54911871e5adf379f3169760961d2f4a75f9f42
config.json841 B (841 B)312355cb9d60690ace3ad8fe687a35626399e043daeb7bd985217b249d89aaaa3fd589b3846e003d8d29d75fb78f0bd892609b41
pytorch_model.bin1.04 GB (1,112,271,561 B)79cd65b0a96245df0e8cd2cfe862031e77bb99b393316a86051c359748c5d5453e7660c69a21a57cfb477892f95f539e3e171196
sentencepiece.bpe.model4.8 MB (5,069,051 B)7e88c49faff6c6c136fdf4a3402d0cb534c6ab10cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
special_tokens_map.json150 B (150 B)6cd1d9021e10d47aed59399af6b0e30312b46ca47638f5bbbe86ef6d604ef28ad3647dc690d6d117c81c0d63e885416be8da1150

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 repositorycardiffnlp/twitter-xlm-roberta-base-sentiment
Revision (pinned)f2f1202b1bdeb07342385c3f807f9c07cd8f5cf8
Fetched at2026-09-03T21:11:31Z
License at fetchno license recorded
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ 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