CoolFace
Modelpublic

subba5076/multilingual-sentiment-xlm-roberta

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes8downloads
Model Card

🌍 Multilingual Sentiment Classifier (XLM-RoBERTa)

This model is a fine-tuned version of xlm-roberta-base for multilingual sentiment classification across English, German, and Italian.

We built this model to classify sentiment into:

  • β€”0 β†’ Negative
  • β€”1 β†’ Neutral
  • β€”2 β†’ Positive

✍️ How We Built It

This model was fine-tuned using the Amazon Reviews Multilingual Dataset, specifically on the English, German, and Italian subsets. Training was done using PyTorch and Hugging Face Transformers.

Preprocessing

  • β€”Texts were tokenized using XLMRobertaTokenizer
  • β€”Labels were mapped to integers (negative: 0, neutral: 1, positive: 2)
  • β€”Dataset was split into train/test/validation using an 80/10/10 ratio

Training

  • β€”Model: xlm-roberta-base
  • β€”Epochs: 2
  • β€”Optimizer: AdamW
  • β€”Batch size: 8
  • β€”Evaluation metric: Macro F1-score
  • β€”Hardware: Google Colab GPU

πŸ” Example Usage

python
from transformers import pipeline

classifier = pipeline("sentiment-analysis", model="subba5076/multilingual-sentiment-xlm-roberta")

classifier("Der Film war unglaublich schΓΆn.")  # German
classifier("This phone is terrible.")           # English
classifier("È stato un buon acquisto.")         # Italian

πŸ“Š Evaluation Macro F1-score on test set: 0.81 Confusion matrix and training curves can be shared in future updates.

πŸ‘¨β€πŸ’» Authors This project was developed as part of a team NLP assignment.

Team Members:

Subrahmanya Rajesh Nayak @subba5076

Rim Tafech

πŸͺͺ License This model is licensed under the MIT License.