AfriBERTa-large, Yorรนbรก tweet sentiment

A 3-class sentiment model (negative, neutral, positive) for Yorรนbรก tweets, including tweets that mix Yorรนbรก and English. It is castorini/afriberta_large fine-tuned on the Yorรนbรก part of AfriSenti-SemEval 2023. It was trained for the demo of the CSC790 Deep Learning project Deep Neural Networks for Semantic Sentiment Analysis in Code-Mixed English-Yorรนbรก Social Media Conversations.

from transformers import pipeline
clf = pipeline("text-classification", model="Olasquare/afriberta-large-yoruba-sentiment", top_k=None)
clf("รณ yรก follow me back แบน แนฃeun", truncation=True, max_length=128)

Training data

AfriSenti-SemEval 2023, Yorรนbรก: 8522 training tweets; dev set with tweets that also appear in training removed (1820 tweets), used only to choose the best epoch; 4515 test tweets. The data is released under CC BY 4.0 by Muhammad et al. (2023) and builds on NaijaSenti (Muhammad et al., 2022). Please cite them.

Training recipe

Same as the AfriBERTa-large runs in the project: seed 42, learning rate 5e-05, batch size 32, maximum length 128 tokens, up to 10 epochs, weight decay 0.01, linear warm-up over 10% of the 10-epoch budget (267 steps), fp16 mixed precision, early stopping with patience 2 on cleaned-dev weighted F1, keeping the best epoch (epoch 3 here). One Tesla T4 GPU, transformers 5.20.2.

Test results (this model, full test set of 4515 tweets)

Metric Score
Weighted F1 71.7
Macro F1 69.9
Accuracy 72.0
Class Precision Recall F1 Tweets
negative 61.9 61.4 61.6 981
neutral 77.0 62.9 69.3 1616
positive 73.4 85.1 78.8 1918

The project report gives the mean of 5 seeds (AfriBERTa-large: 72.5 weighted F1, AfroXLMR-large: 73.6; the two are statistically tied). This model is a single run (seed 42), so its score differs slightly from the report.

Limitations

  • Trained and tested on tweets from one platform (Twitter/X) only; other kinds of text may get worse results.
  • Its main errors are on proverbs and idioms, sarcasm, and slang.
  • Only 3 classes; mixed feelings in one tweet are forced into one label.
  • Not for high-stakes decisions about people (for example moderation, hiring or credit). Use it for research and demonstration.

Authors

Saheed Olayemi Olayinka and Samson Akinyele Fagbenjo, Department of Computer Science, University of Ibadan. Code: https://github.com/Olasquare043/yoruba-codemix-sentiment

Downloads last month
37
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Olasquare/afriberta-large-yoruba-sentiment

Finetuned
(34)
this model

Dataset used to train Olasquare/afriberta-large-yoruba-sentiment

Evaluation results