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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- nso
|
| 4 |
+
license: cc-by-nc-sa-4.0
|
| 5 |
+
tags:
|
| 6 |
+
- sepedi
|
| 7 |
+
- northern-sotho
|
| 8 |
+
- nso
|
| 9 |
+
- african-languages
|
| 10 |
+
- language-model
|
| 11 |
+
- masked-language-modeling
|
| 12 |
+
- low-resource
|
| 13 |
+
- south-africa
|
| 14 |
+
- limpopo
|
| 15 |
+
datasets:
|
| 16 |
+
- Sediba-AI/sepedi-training-v1
|
| 17 |
+
base_model: xlm-roberta-base
|
| 18 |
+
model-index:
|
| 19 |
+
- name: Sediba-AI/sepedi-llama-v1
|
| 20 |
+
results: []
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# Sepedi-Llama v1
|
| 24 |
+
|
| 25 |
+
**First open-source continued pre-training of XLM-RoBERTa on Sepedi (Northern Sotho)**
|
| 26 |
+
|
| 27 |
+
Developed by [Sediba AI](https://huggingface.co/Sediba-AI) / [TSEBO SOVEREIGN TECH (Pty) Ltd](https://github.com/Sediba-AI)
|
| 28 |
+
Mankweng, Limpopo, South Africa
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## Model Description
|
| 33 |
+
|
| 34 |
+
Sepedi-Llama v1 is a continued pre-training of `xlm-roberta-base` on a 376,803-record clean Sepedi corpus. It is the first publicly available language model specifically trained on Sepedi (ISO 639-3: `nso`) at this scale.
|
| 35 |
+
|
| 36 |
+
Sepedi (Northern Sotho / Sesotho sa Leboa) is spoken by approximately **4.6 million people** in Limpopo, Gauteng, and Mpumalanga provinces of South Africa. Despite being one of South Africa's 11 official languages, it has near-zero representation in existing NLP infrastructure.
|
| 37 |
+
|
| 38 |
+
This model is the foundation layer of the **Sediba AI** intelligence platform — a community-sovereign AI system serving Sepedi-speaking communities in Limpopo.
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## Intended Uses
|
| 43 |
+
|
| 44 |
+
### Primary uses
|
| 45 |
+
- **Fine-tuning** for downstream Sepedi NLP tasks:
|
| 46 |
+
- Sentiment classification
|
| 47 |
+
- Named Entity Recognition (NER)
|
| 48 |
+
- Text classification
|
| 49 |
+
- Question answering
|
| 50 |
+
- **EduIntel** — curriculum AI assistant for Grade 10-12 Sepedi teachers (Morutabana platform)
|
| 51 |
+
- **Research** — low-resource African language NLP
|
| 52 |
+
|
| 53 |
+
### Out-of-scope uses
|
| 54 |
+
- Production text generation without further fine-tuning
|
| 55 |
+
- Languages other than Sepedi/Northern Sotho
|
| 56 |
+
- Commercial use without review of the CC BY-NC-SA 4.0 license terms
|
| 57 |
+
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
+
## Training Details
|
| 61 |
+
|
| 62 |
+
### Training Data
|
| 63 |
+
|
| 64 |
+
| Source | Records | License | Notes |
|
| 65 |
+
|--------|---------|---------|-------|
|
| 66 |
+
| Autshumato Monolingual Sepedi v2.1 | 91,347 | CC BY | SADiLaR |
|
| 67 |
+
| Autshumato Bilingual Sepedi-English (NSO side) | 122,665 | CC BY | SADiLaR |
|
| 68 |
+
| NCHLT RAW Sepedi corpus | 63,984 | CC BY 4.0 | CTexT/NWU |
|
| 69 |
+
| FineWeb-2 NSO subset | 144,611 | CC BY 4.0 | HuggingFaceFW |
|
| 70 |
+
| Sepedi Bible | 30,616 | Public domain | |
|
| 71 |
+
| Wikipedia NSO | 18,347 | CC BY-SA | wikimedia |
|
| 72 |
+
| DBE NSC exam papers 2017-2025 | 195 documents | Public domain | Grade 10-12 |
|
| 73 |
+
| DBE Annual Teaching Plans 2023 | 9 documents | Public domain | Grade 10-12 |
|
| 74 |
+
| **Total** | **376,803 records** | | |
|
| 75 |
+
|
| 76 |
+
Full dataset: [Sediba-AI/sepedi-training-v1](https://huggingface.co/datasets/Sediba-AI/sepedi-training-v1)
|
| 77 |
+
|
| 78 |
+
### Training Procedure
|
| 79 |
+
|
| 80 |
+
| Parameter | Value |
|
| 81 |
+
|-----------|-------|
|
| 82 |
+
| Base model | `xlm-roberta-base` |
|
| 83 |
+
| Training objective | Masked Language Modeling (MLM, 15% mask rate) |
|
| 84 |
+
| Epochs | 1 |
|
| 85 |
+
| Batch size (effective) | 32 (2 per device × 16 accumulation steps) |
|
| 86 |
+
| Max sequence length | 64 tokens |
|
| 87 |
+
| Learning rate | 5e-5 with linear warmup (200 steps) |
|
| 88 |
+
| Weight decay | 0.01 |
|
| 89 |
+
| Hardware | Tesla T4 (16GB VRAM) |
|
| 90 |
+
| Training time | 10 hours 3 minutes |
|
| 91 |
+
| Framework | HuggingFace Transformers 4.x |
|
| 92 |
+
|
| 93 |
+
### Training Loss
|
| 94 |
+
|
| 95 |
+
| Epoch | Step | Loss |
|
| 96 |
+
|-------|------|------|
|
| 97 |
+
| 0.00 | 0 | — |
|
| 98 |
+
| 0.004 | 50 | 83.27 |
|
| 99 |
+
| 0.085 | 1000 | ~35 |
|
| 100 |
+
| 0.25 | 3000 | ~26 |
|
| 101 |
+
| 0.50 | 5900 | ~22 |
|
| 102 |
+
| 0.75 | 8800 | ~20 |
|
| 103 |
+
| 1.00 | 11776 | **19.04** |
|
| 104 |
+
|
| 105 |
+
**Final training loss: 25.45 (average) | 19.04 (final step)**
|
| 106 |
+
Loss reduction: 83.27 → 19.04 (**77% reduction**)
|
| 107 |
+
|
| 108 |
+
---
|
| 109 |
+
|
| 110 |
+
## Evaluation
|
| 111 |
+
|
| 112 |
+
Formal evaluation benchmarks (FLORES-200, MasakhaNER) are pending. This is a v1 release intended to establish a baseline and receive community feedback.
|
| 113 |
+
|
| 114 |
+
Downstream fine-tuning experiments:
|
| 115 |
+
- Sepedi sentiment classification (in progress — Sediba-AI/sepedi-sentiment-classifier)
|
| 116 |
+
- EduIntel curriculum QA (deployed to Morutabana dashboard)
|
| 117 |
+
|
| 118 |
+
---
|
| 119 |
+
|
| 120 |
+
## Limitations
|
| 121 |
+
|
| 122 |
+
- **Short sequence length**: Trained with max_length=64 due to GPU memory constraints. May underperform on longer documents. Future versions will train at max_length=512 with larger GPU allocation.
|
| 123 |
+
- **1 epoch only**: Single-epoch training is a starting point. Further training will improve performance significantly.
|
| 124 |
+
- **Informal register**: Training data is primarily formal text (government, education, religious). Performance on informal/conversational Sepedi may be limited.
|
| 125 |
+
- **Dialect coverage**: Sepedi has multiple dialect zones (Sekhukhune, Balobedu, Batlokwa etc.). Current corpus does not tag dialect zones.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
## Ethical Considerations
|
| 130 |
+
|
| 131 |
+
### Data sovereignty
|
| 132 |
+
This model was developed under the **Sediba Sovereignty Framework**:
|
| 133 |
+
- Training data sourced from publicly licensed corpora
|
| 134 |
+
- Community data collected via Leotša la Sepedi with contributor consent (FPIC framework)
|
| 135 |
+
- Commercial use governed by TSEBO SOVEREIGN TECH (Pty) Ltd — **25% of commercial revenue flows to Sediba AI NPC** (community non-profit)
|
| 136 |
+
|
| 137 |
+
### Language sovereignty
|
| 138 |
+
Sepedi speakers have historically been excluded from AI development. This model is built **by and for** the Sepedi-speaking community in Limpopo, with the explicit goal of returning AI capability to the community that speaks the language.
|
| 139 |
+
|
| 140 |
+
### Bias and risks
|
| 141 |
+
- Religious text (Sepedi Bible) may introduce theological framing in certain contexts
|
| 142 |
+
- Government/educational text may reflect formal register bias
|
| 143 |
+
- Model reflects biases present in web-crawled text (FineWeb-2)
|
| 144 |
+
|
| 145 |
+
---
|
| 146 |
+
|
| 147 |
+
## How to Use
|
| 148 |
+
|
| 149 |
+
```python
|
| 150 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
| 151 |
+
import torch
|
| 152 |
+
|
| 153 |
+
tokenizer = AutoTokenizer.from_pretrained("Sediba-AI/sepedi-llama-v1")
|
| 154 |
+
model = AutoModelForMaskedLM.from_pretrained("Sediba-AI/sepedi-llama-v1")
|
| 155 |
+
|
| 156 |
+
# Example: fill-mask in Sepedi
|
| 157 |
+
text = "Baithuti ba <mask> go bala dipuku tša Sepedi."
|
| 158 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 159 |
+
|
| 160 |
+
with torch.no_grad():
|
| 161 |
+
outputs = model(**inputs)
|
| 162 |
+
|
| 163 |
+
# Get top predictions for masked token
|
| 164 |
+
mask_idx = (inputs["input_ids"] == tokenizer.mask_token_id).nonzero()[0][1]
|
| 165 |
+
logits = outputs.logits[0, mask_idx]
|
| 166 |
+
top_tokens = tokenizer.convert_ids_to_tokens(logits.topk(5).indices)
|
| 167 |
+
print("Top predictions:", top_tokens)
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
### Fine-tuning for classification
|
| 171 |
+
|
| 172 |
+
```python
|
| 173 |
+
from transformers import AutoModelForSequenceClassification
|
| 174 |
+
|
| 175 |
+
model = AutoModelForSequenceClassification.from_pretrained(
|
| 176 |
+
"Sediba-AI/sepedi-llama-v1",
|
| 177 |
+
num_labels=3 # e.g. positive/neutral/negative
|
| 178 |
+
)
|
| 179 |
+
```
|
| 180 |
+
|
| 181 |
+
---
|
| 182 |
+
|
| 183 |
+
## Citation
|
| 184 |
+
|
| 185 |
+
```bibtex
|
| 186 |
+
@misc{sepedi-llama-v1-2026,
|
| 187 |
+
author = {Lehlohonolo Lemekoana and Sediba AI},
|
| 188 |
+
title = {Sepedi-Llama v1: Continued Pre-training of XLM-RoBERTa on Sepedi},
|
| 189 |
+
year = {2026},
|
| 190 |
+
publisher = {HuggingFace},
|
| 191 |
+
url = {https://huggingface.co/Sediba-AI/sepedi-llama-v1},
|
| 192 |
+
note = {TSEBO SOVEREIGN TECH (Pty) Ltd, Mankweng, Limpopo, South Africa}
|
| 193 |
+
}
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
---
|
| 197 |
+
|
| 198 |
+
## Related Resources
|
| 199 |
+
|
| 200 |
+
| Resource | Link |
|
| 201 |
+
|----------|------|
|
| 202 |
+
| Training dataset | [Sediba-AI/sepedi-training-v1](https://huggingface.co/datasets/Sediba-AI/sepedi-training-v1) |
|
| 203 |
+
| Sentiment classifier | [Sediba-AI/sepedi-sentiment-classifier](https://huggingface.co/Sediba-AI/sepedi-sentiment-classifier) |
|
| 204 |
+
| Data collection platform | [Leotša la Sepedi](https://github.com/Sediba-AI) |
|
| 205 |
+
| Organisation | [Sediba-AI on HuggingFace](https://huggingface.co/Sediba-AI) |
|
| 206 |
+
| GitHub | [github.com/Sediba-AI](https://github.com/Sediba-AI) |
|
| 207 |
+
|
| 208 |
+
---
|
| 209 |
+
|
| 210 |
+
## Acknowledgements
|
| 211 |
+
|
| 212 |
+
- **SADiLaR** (South African Centre for Digital Language Resources) — Autshumato and NCHLT corpora
|
| 213 |
+
- **CTexT, NWU** — NCHLT speech and text resources
|
| 214 |
+
- **Masakhane** — African NLP community and benchmarks
|
| 215 |
+
- **Department of Basic Education, South Africa** — NSC exam papers and Annual Teaching Plans (public domain)
|
| 216 |
+
- **HuggingFaceFW** — FineWeb-2 NSO subset
|
| 217 |
+
- **Anri Lombard** — MzansiLM reference architecture
|
| 218 |
+
|
| 219 |
+
---
|
| 220 |
+
|
| 221 |
+
*Built in Mankweng, Limpopo. Powering the invisible foundations.*
|
| 222 |
+
*Sediba AI — Making the unseen ours and seen.*
|