Downloads · 30 days
0
NaolBM/Oromo-BBPE
Oromo-BBPE is a token classification model from NaolBM. 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.
A highly efficient Byte-Level BPE tokenizer specifically designed for Afaan Oromo with a compact 12,000 vocabulary size - achieving 6.13 chars/token on Oromo text, dramatically outperforming general-purpose tokenizers.
Downloads · 30 days
0
Access
Public
Updated Feb 18, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json994 KB · 99%
From the Hugging Face model README
NaolBM/Oromo-BBPE)A highly efficient Byte-Level BPE tokenizer specifically designed for Afaan Oromo with a compact 12,000 vocabulary size - achieving 6.13 chars/token on Oromo text, dramatically outperforming general-purpose tokenizers.
Test Sentence:
"Dabalataan bu'uuraaleen misoomaa akka daandii qonnaan bultoonni omisha isaanii karaa salphaa ta'een gabaaf akka dhiyeessan carraa uumu himan."
| Model | Tokens | Chars/Token | Efficiency vs. Oromo-BBPE |
|---|---|---|---|
| Oromo-BBPE (Ours) | 23 | 6.13 | baseline |
| Qwen3 | 54 | 2.61 | 2.3x worse |
| Llama-3.2 | 53 | 2.66 | 2.3x worse |
| gemma-3 | 51 | 2.76 | 2.2x worse |
| gpt-oss | 45 | 3.13 | 2.0x worse |
| DeepSeek-V3.2 | 57 | 2.47 | 2.5x worse |
Key Insight: Oromo-BBPE uses 2.3-2.5x fewer tokens than mainstream tokenizers for the same Oromo text, meaning you can fit more than twice the content in the same context window!
Most tokenizers are trained on English or other high-resource languages, leading to catastrophic fragmentation of Afaan Oromo words. A word like "dubbataman" might become ['d', 'ub', 'bat', 'aman'] - losing all morphological meaning and wasting precious tokens.
Oromo-BBPE solves this by:
castorini/afriberta-corpus (Afaan Oromo section)Ġ prefix)<|startoftext|>, <|endoftext|>, <|pad|>tokenizer.json: Full tokenizer configurationtokenizer_config.json: Hugging Face-compatible configurationspecial_tokens_map.json: Special tokens mappingfrom transformers import AutoTokenizer
# Load Oromo-BBPE tokenizer
tokenizer = AutoTokenizer.from_pretrained("NaolBM/Oromo-BBPE")
# Tokenize Afaan Oromo text efficiently!
text = "Dabalataan bu'uuraaleen misoomaa akka daandii qonnaan bultoonni omisha isaanii karaa salphaa ta'een gabaaf akka dhiyeessan carraa uumu himan."
tokens = tokenizer.tokenize(text)
ids = tokenizer.encode(text)
print(f"Text: {text}")
print(f"Tokens ({len(tokens)}): {tokens}")
print(f"Token IDs: {ids}")
print(f"Efficiency: {len(text)/len(tokens):.2f} chars/token")
Want to add Oromo capability to any existing model (Llama, Qwen, Gemma, etc.)? Here's how:
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load tokenizers
oromo = AutoTokenizer.from_pretrained("NaolBM/Oromo-BBPE")
target = AutoTokenizer.from_pretrained("your-target-model") # e.g., "meta-llama/Llama-3.2-1B"
# Get all Oromo token IDs (excluding special tokens)
new_tokens_ids = [
id for id in range(oromo.vocab_size)
if oromo.decode([id]) not in target.all_special_tokens
]
# 🔑 CRITICAL: Decode Oromo tokens to readable Afaan Oromo before adding!
# decode() converts 'Ġqabatte' back to " qabatte" or 'Kanaadaan' to "Kanaadaan"
tokens_to_add = [oromo.decode([id]) for id in new_tokens_ids]
# Remove duplicates and empty strings
decoded_tokens = [t for t in set(tokens_to_add) if t.strip()]
print(f"Adding {len(decoded_tokens)} Oromo tokens to {target.__class__.__name__}")
# Add to target tokenizer
target.add_tokens(decoded_tokens)
# Resize model embeddings
model = AutoModelForCausalLM.from_pretrained("your-target-model")
model.resize_token_embeddings(len(target))
# Now your model understands Afaan Oromo!
test_text = "Akka Oromoo dhalatte?"
tokens = target.tokenize(test_text)
print(f"Tokens: {tokens}") # Will show proper Oromo segmentation
# WRONG: Adding raw byte tokens (they won't match input text!)
target.add_tokens(list(oromo.get_vocab().keys()))
# RIGHT: Decode first, then add
decoded = oromo.decode([token_id]) # Converts byte representation → actual Oromo text
target.add_tokens([decoded]) # Now matches what appears in input!
Why this works: Oromo-BBPE stores tokens with byte-level prefixes (like Ġ for spaces), but when extending another tokenizer, you need the actual visible text that appears in your training corpus. decode() bridges this gap.
This tokenizer is ideal for:
castorini/afriberta-corpus - domain may be slightly biased toward news/textbook contentThe tokenizer was evaluated on:
This tokenizer is licensed under the MIT License - free for commercial and research use.
@misc{naol2026oromobbpe,
title={Oromo-BBPE: An Efficient Byte-Level BPE Tokenizer for Afaan Oromo},
author={Naol},
year={2026},
howpublished={\url{https://huggingface.co/NaolBM/Oromo-BBPE}},
}
Available on Hugging Face Hub:
NaolBM/Oromo-BBPE
castorini/afriberta-corpus (Afaan Oromo section)Contributions welcome! Areas for improvement: