akuru-token · tokenizer demo · v…

How text becomes tokens

Full BPE tokenization with trained merge rules. Both vocabularies are trained on the same Sinhala-English corpus, the difference is only in how text is split before BPE runs: grapheme clusters vs Unicode codepoints.

GitHub ↗
sin_eng Loading…
sin_eng_gpt2 Loading…
try:
How it works. Both vocab files are fetched from GitHub on page load. The merge rules from each JSON are used to run the full BPE algorithm - each word is split into base symbols (grapheme clusters for sin_eng, codepoints for sin_eng_gpt2), then the lowest-ranked merge pair is applied repeatedly, exactly matching BPETokenizer._bpe() in Python.

About the vocabs. sin_eng and sin_eng_gpt2 are both trained from scratch on the same Sinhala–English corpus. sin_eng_gpt2 is not the original GPT-2 vocabulary. It uses the GPT-2 pre-tokenization strategy (regex word splitting, codepoint symbols) but with merge rules learned entirely from our training data. Same corpus, same vocab size, different atomic unit.

Token IDs appear on each chip (hover for the full ID). Space marker Ġ encodes a leading space so word boundaries are preserved without a separate token.