Downloads · 30 days
7
6% of all-time downloads
LyngualLabs/yoruba-en-ner-model-small
yoruba-en-ner-model-small is a token classification model from LyngualLabs. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
This model is a highly efficient, fine-tuned version of Davlan/afro-xlmr-mini designed for token-level Language Identification (LID) in Yoruba-English code-switched text.
Downloads · 30 days
7
6% of all-time downloads
All-time downloads
120
Public
Parameters
117M
2.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors470 MB · 95%
From the Hugging Face model README
This model is a highly efficient, fine-tuned version of Davlan/afro-xlmr-mini designed for token-level Language Identification (LID) in Yoruba-English code-switched text.
The following results were obtained on the held-out test set (~80k tokens):
| Language | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Overall | 0.990 | 0.991 | 0.991 | 80,085 |
| English | 0.994 | 0.995 | 0.994 | 63,016 |
| Yoruba | 0.976 | 0.978 | 0.977 | 17,069 |
In our research, we compared this "Mini" architecture against a "Large" baseline to evaluate the trade-off between size and accuracy:
| Model | Parameters | Overall F1 | Speed (Samples/sec) |
|---|---|---|---|
| AfroXLM-R Large | 550M | 99.07% | ~300 |
| AfroXLM-R Mini | 17M | 99.05% | 1712 |
The model was trained for 5 epochs on an A100 GPU. We utilized a large global batch size (256) and mixed-precision training (BF16) to ensure stable and fast convergence. Unlike larger models that may overfit rapidly on LID tasks, the Mini architecture showed a healthy learning curve with validation loss steadily decreasing throughout the process.
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| No log | 1.0 | 313 | 0.2852 |
| 0.4325 | 2.0 | 626 | 0.1622 |
| 0.4325 | 3.0 | 939 | 0.1153 |
| 0.1482 | 4.0 | 1252 | 0.1000 |
| 0.1039 | 5.0 | 1565 | 0.0977 |
from transformers import pipeline
# Load the model directly from the Hub
lid_model = pipeline("token-classification", model="Professor/yoruba-en-ner-model-small")
text = "Ẹ jẹ́ kí á lọ si cinema to watch the latest movie."
results = lid_model(text)
for entity in results:
print(f"Token: {entity['word']}, Language: {entity['entity']}")
This model is intended for researchers and developers working on bilingual text processing for Nigerian English and Yoruba. While highly accurate, users should note that performance may vary on text with non-standard orthography or code-switching involving third languages (e.g., Nigerian Pidgin).
If you use this model in your research, please cite the original AfroXLM-R paper and this specific fine-tuned release.