Downloads · 30 days
11
8% of all-time downloads
Professor/yoruba-en-ner-model
yoruba-en-ner-model is a token classification model from Professor. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of AfroXLM-R-Large designed to identify language boundaries in Yoruba-English code-switched text at the token level.
Downloads · 30 days
11
8% of all-time downloads
All-time downloads
134
Public
Parameters
559M
11.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.2 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of AfroXLM-R-Large designed to identify language boundaries in Yoruba-English code-switched text at the token level.
The model classifies each token in a sentence into one of three categories:
By utilizing the AfroXLM-R-Large backbone, which was pre-trained with a focus on African languages, this model demonstrates exceptional robustness in handling the morphological complexities of Yoruba and the fluid transitions in code-switched speech.
The model achieved near-perfect performance. Peak generalization was reached at Epoch 1. While training continued for 5 epochs for observation, the final deployed weights are from the first epoch to ensure maximum generalizability and prevent over-memorization of training samples.
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Overall | 0.991 | 0.991 | 0.991 | ~80k |
| English | 0.995 | 0.994 | 0.994 | 63,016 |
| Yoruba | 0.976 | 0.979 | 0.978 | 17,069 |
The model converges remarkably fast due to the pre-existing linguistic knowledge in the AfroXLM-R base. Users will notice that Validation Loss is lowest at Epoch 1.0 ($0.0240$). Despite the training loss continuing to drop, the validation loss begins a slight upward trend thereafter, indicating that the model captures the underlying linguistic boundaries almost immediately.
from transformers import pipeline
lid_model = pipeline("token-classification", model="your-username/yoruba-en-ner-model")
text = "Egungun eleru helps to cleanse the village by carrying ebo"
results = lid_model(text)
for entity in results:
print(f"Token: {entity['word']}, Language: {entity['entity']}")
If you use this model in your research, please cite the Masakhane AfroXLM-R paper and this fine-tuned version.