AfroLM has been pretrained from scratch on 23 African Languages: Amharic, Afan Oromo, Bambara, Ghomalá, Éwé, Fon, Hausa, Ìgbò, Kinyarwanda, Lingala, Luganda, Luo, Mooré, Chewa, Naija, Shona, Swahili, Setswana, Twi, Wolof, Xhosa, Yorùbá, and Zulu.
Evaluation Results
AfroLM was evaluated on MasakhaNER1.0 (10 African Languages) and MasakhaNER2.0 (21 African Languages) datasets; on text classification and sentiment analysis. AfroLM outperformed AfriBERTa, mBERT, and XLMR-base, and was very competitive with AfroXLMR. AfroLM is also very data efficient because it was pretrained on a dataset 14x+ smaller than its competitors' datasets. Below are the average F1-score performances of various models, across various datasets. Please consult our paper for more language-level performance.
Model
MasakhaNER
MasakhaNER2.0*
Text Classification (Yoruba/Hausa)
Sentiment Analysis (YOSM)
OOD Sentiment Analysis (Twitter -> YOSM)
AfroLM-Large
80.13
83.26
82.90/91.00
85.40
68.70
AfriBERTa
79.10
81.31
83.22/90.86
82.70
65.90
mBERT
71.55
80.68
---
---
---
XLMR-base
79.16
83.09
---
---
---
AfroXLMR-base
81.90
84.55
---
---
---
(*) The evaluation was made on the 11 additional languages of the dataset.
Bold numbers represent the performance of the model with the
smallest pretrained data
.
from transformers import XLMRobertaModel, XLMRobertaTokenizer
model = XLMRobertaModel.from_pretrained("bonadossou/afrolm_active_learning")
tokenizer = XLMRobertaTokenizer.from_pretrained("bonadossou/afrolm_active_learning")
tokenizer.model_max_length = 256
Autotokenizer
class does not successfully load our tokenizer. So we recommend to use directly the
XLMRobertaTokenizer
class. Depending on your task, you will load the according mode of the model. Read the
XLMRoberta Documentation
Reproducing our result: Training and Evaluation
To train the network, run
python active_learning.py
. You can also wrap it around a
bash
script.
For the evaluation:
NER Classification:
bash ner_experiments.sh
Text Classification & Sentiment Analysis:
bash text_classification_all.sh
Citation
@inproceedings{dossou-etal-2022-afrolm, title = "{A}fro{LM}: A Self-Active Learning-based Multilingual Pretrained Language Model for 23 {A}frican Languages", author = "Dossou, Bonaventure F. P. and Tonja, Atnafu Lambebo and Yousuf, Oreen and Osei, Salomey and Oppong, Abigail and Shode, Iyanuoluwa and Awoyomi, Oluwabusayo Olufunke and Emezue, Chris", booktitle = "Proceedings of The Third Workshop on Simple and Efficient Natural Language Processing (SustaiNLP)", month = dec, year = "2022", address = "Abu Dhabi, United Arab Emirates (Hybrid)", publisher = "Association for Computational Linguistics", url = "https://aclanthology.org/2022.sustainlp-1.11", pages = "52--64"}
We will share the official proceeding citation as soon as possible. Stay tuned, and if you have liked our work, give it a star.
Reach out
Do you have a question? Please create an issue and we will reach out as soon as possible
Runs of bonadossou afrolm_active_learning on huggingface.co
585
Total runs
-35
24-hour runs
-112
3-day runs
-201
7-day runs
-2.5K
30-day runs
More Information About afrolm_active_learning huggingface.co Model
afrolm_active_learning huggingface.co is an AI model on huggingface.co that provides afrolm_active_learning's model effect (), which can be used instantly with this bonadossou afrolm_active_learning model. huggingface.co supports a free trial of the afrolm_active_learning model, and also provides paid use of the afrolm_active_learning. Support call afrolm_active_learning model through api, including Node.js, Python, http.
afrolm_active_learning huggingface.co is an online trial and call api platform, which integrates afrolm_active_learning's modeling effects, including api services, and provides a free online trial of afrolm_active_learning, you can try afrolm_active_learning online for free by clicking the link below.
bonadossou afrolm_active_learning online free url in huggingface.co:
afrolm_active_learning is an open source model from GitHub that offers a free installation service, and any user can find afrolm_active_learning on GitHub to install. At the same time, huggingface.co provides the effect of afrolm_active_learning install, users can directly use afrolm_active_learning installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
afrolm_active_learning install url in huggingface.co: