Downloads · 30 days
0
RavinduPabasara/sinhala-bpe-32k
sinhala-bpe-32k is a machine learning model from RavinduPabasara. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A SentencePiece BPE tokenizer for Sinhala (32k vocab, character coverage 0.9999), trained on the deduplicated OSCAR Sinhala corpus.
Downloads · 30 days
0
Access
Public
Updated Jul 17, 2026
Repo size
1.1 MB
Likes
0
Public
Click a slice to open those files.
.model1.1 MB · 57%
From the Hugging Face model README
A SentencePiece BPE tokenizer for Sinhala (32k vocab, character coverage 0.9999), trained on the deduplicated OSCAR Sinhala corpus.
On Sinhala text it reaches fertility 1.58 (tokens per word) with UNK rate ≈ 0.0007 — 1.3–2× more efficient than 200k–250k multilingual vocabularies (XLM-R 2.04, GPT-4o's o200k 3.26, GPT-4's cl100k 9.80), measured with tokscope. Full comparison: the Sinhala tokenizer study.
import sentencepiece as spm
from huggingface_hub import hf_hub_download
path = hf_hub_download("RavinduPabasara/sinhala-bpe-32k", "sinhala_bpe_v2.model")
sp = spm.SentencePieceProcessor(model_file=path)
sp.encode_as_pieces("මම සිංහල භාෂාව ඉගෙන ගනිමි.")
# ['▁මම', '▁සිංහල', '▁භාෂාව', '▁ඉගෙන', '▁ගනි', 'මි', '.']
Special ids: pad=0, unk=1, bos=2, eos=3.
OSCAR Sinhala subset (~100k lines), cleaned with the pipeline in SinhalaCustomTokenizer. OSCAR's own terms apply to the underlying text; this repository distributes only the trained tokenizer model, not the corpus.
Ravindu Pabasara Karunarathna — BSc (Hons) in AI undergraduate, University of Moratuwa, Sri Lanka.