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.
In our research, we compared this "Mini" architecture against a "Large" baseline to evaluate the trade-off between size and accuracy:
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.
1from transformers import pipeline
2
3# Load the model directly from the Hub
4lid_model = pipeline("token-classification", model="Professor/yoruba-en-ner-model-small")
5
6text = "Ẹ jẹ́ kí á lọ si cinema to watch the latest movie."
7results = lid_model(text)
8
9for entity in results:
10 print(f"Token: {entity['word']}, Language: {entity['entity']}")
11
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.