Downloads · 30 days
0
fahadqazi/Sindhi-BPE-Tokenizer
Sindhi-BPE-Tokenizer is a machine learning model from fahadqazi. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
A Byte-Pair Encoding (BPE) tokenizer works by grouping frequently occurring pairs of characters instead of splitting text into words or individual characters. By training on a Sindhi Twitter dataset, this tokenizer ca…
Downloads · 30 days
0
Access
Public
Updated Nov 14, 2024
Repo size
—
Likes
3
Public
Click a slice to open those files.
.json1.2 MB · 100%
From the Hugging Face model README
A Byte-Pair Encoding (BPE) tokenizer works by grouping frequently occurring pairs of characters instead of splitting text into words or individual characters. By training on a Sindhi Twitter dataset, this tokenizer captures common letter combinations in Sindhi, preserving the language's phonetic structure.
The key advantage of BPE is its ability to handle unknown words. Similar to how we can pronounce a new word by recognizing character pairings, the BPE tokenizer breaks down unfamiliar words into smaller, familiar sub-units, making it robust for unseen terms while maintaining consistency with the language's sound patterns.
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("fahadqazi/Sindhi-BPE-Tokenizer")
encoded = tokenizer.encode("ڪهڙا حال آهن")
decoded = tokenizer.decode(encoded.ids)
print("Encoded tokens: ", encoded.tokens) # output: ['Úª', 'Ùĩ', 'ÚĻØ§', 'ĠØŃاÙĦ', 'ĠØ¢ÙĩÙĨ']
print("Decoded text: ", decoded) # output: ڪهڙا حال آهن