Introduction of naija-twitter-sentiment-afriberta-large
Model Details of naija-twitter-sentiment-afriberta-large
Hugging Face's logo
language:
hau
ibo
pcm
yor
multilingual
naija-twitter-sentiment-afriberta-large
Model description
naija-twitter-sentiment-afriberta-large
is the first multilingual twitter
sentiment classification
model for four (4) Nigerian languages (Hausa, Igbo, Nigerian Pidgin, and Yorùbá) based on a fine-tuned castorini/afriberta_large large model.
It achieves the
state-of-the-art performance
for the twitter sentiment classification task trained on the
NaijaSenti corpus
.
The model has been trained to classify tweets into 3 sentiment classes: negative, neutral and positive
Specifically, this model is a
xlm-roberta-large
model that was fine-tuned on an aggregation of 4 Nigerian language datasets obtained from
NaijaSenti
dataset.
Intended uses & limitations
How to use
You can use this model with Transformers for Sentiment Classification.
from transformers import AutoModelForSequenceClassification
from transformers import AutoTokenizer
import numpy as np
from scipy.special import softmax
MODEL = "Davlan/naija-twitter-sentiment-afriberta-large"
tokenizer = AutoTokenizer.from_pretrained(MODEL)
# PT
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
text = "I like you"
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
scores = output[0][0].detach().numpy()
scores = softmax(scores)
id2label = {0:"positive", 1:"neutral", 2:"negative"}
ranking = np.argsort(scores)
ranking = ranking[::-1]
for i inrange(scores.shape[0]):
l = id2label[ranking[i]]
s = scores[ranking[i]]
print(f"{i+1}) {l}{np.round(float(s), 4)}")
Limitations and bias
This model is limited by its training dataset and domain i.e Twitter. This may not generalize well for all use cases in different domains.
Training procedure
This model was trained on a single Nvidia RTX 2080 GPU with recommended hyperparameters from the
original NaijaSenti paper
.
Eval results on Test set (F-score), average over 5 runs.
language
F1-score
hau
81.2
ibo
80.8
pcm
74.5
yor
80.4
BibTeX entry and citation info
@inproceedings{Muhammad2022NaijaSentiAN,
title={NaijaSenti: A Nigerian Twitter Sentiment Corpus for Multilingual Sentiment Analysis},
author={Shamsuddeen Hassan Muhammad and David Ifeoluwa Adelani and Sebastian Ruder and Ibrahim Said Ahmad and Idris Abdulmumin and Bello Shehu Bello and Monojit Choudhury and Chris C. Emezue and Saheed Salahudeen Abdullahi and Anuoluwapo Aremu and Alipio Jeorge and Pavel B. Brazdil},
year={2022}
}
Runs of Davlan naija-twitter-sentiment-afriberta-large on huggingface.co
121
Total runs
-2
24-hour runs
-11
3-day runs
-31
7-day runs
-42
30-day runs
More Information About naija-twitter-sentiment-afriberta-large huggingface.co Model
naija-twitter-sentiment-afriberta-large huggingface.co is an AI model on huggingface.co that provides naija-twitter-sentiment-afriberta-large's model effect (), which can be used instantly with this Davlan naija-twitter-sentiment-afriberta-large model. huggingface.co supports a free trial of the naija-twitter-sentiment-afriberta-large model, and also provides paid use of the naija-twitter-sentiment-afriberta-large. Support call naija-twitter-sentiment-afriberta-large model through api, including Node.js, Python, http.
naija-twitter-sentiment-afriberta-large huggingface.co is an online trial and call api platform, which integrates naija-twitter-sentiment-afriberta-large's modeling effects, including api services, and provides a free online trial of naija-twitter-sentiment-afriberta-large, you can try naija-twitter-sentiment-afriberta-large online for free by clicking the link below.
Davlan naija-twitter-sentiment-afriberta-large online free url in huggingface.co:
naija-twitter-sentiment-afriberta-large is an open source model from GitHub that offers a free installation service, and any user can find naija-twitter-sentiment-afriberta-large on GitHub to install. At the same time, huggingface.co provides the effect of naija-twitter-sentiment-afriberta-large install, users can directly use naija-twitter-sentiment-afriberta-large installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
naija-twitter-sentiment-afriberta-large install url in huggingface.co: