Downloads · 30 days
0
agileabhi/hindi-bpe-tokenizer
hindi-bpe-tokenizer is a token classification model from agileabhi. Use it when you need labels on individual words, such as names. The card lists the license as mit.
A Byte Pair Encoding (BPE) tokenizer specifically designed for Hindi text, using grapheme-level tokenization to properly handle Devanagari script.
Downloads · 30 days
0
Access
Public
Updated Nov 8, 2025
Repo size
56.8 MB
Likes
0
Public
Click a slice to open those files.
.json28.5 MB · 50%
From the Hugging Face model README
A Byte Pair Encoding (BPE) tokenizer specifically designed for Hindi text, using grapheme-level tokenization to properly handle Devanagari script.
This tokenizer implements the BPE algorithm at the grapheme level rather than byte level, which is crucial for Hindi because:
The tokenizer achieves excellent compression while maintaining perfect reversibility:
from hindi_tokenizer import HindiTokenizer
import pickle
# Load the tokenizer
with open('hindi_tokenizer.pkl', 'rb') as f:
tokenizer = pickle.load(f)
# Encode text
text = "मार्केट ट्रेंड्स को समझना"
encoded = tokenizer.encode(text)
print(f"Token IDs: {encoded}")
# Decode back
decoded = tokenizer.decode(encoded)
print(f"Decoded: {decoded}")
# Get compression stats
stats = tokenizer.get_compression_stats(text)
print(f"Compression: {stats['byte_compression_ratio']:.2f}x")
pip install regex
This tokenizer is trained on Hindi text and is optimized for Devanagari script. Performance may vary on:
If you use this tokenizer in your research, please cite:
@software{hindi_bpe_tokenizer,
title = {Hindi BPE Tokenizer},
author = {agileabhi},
year = {2025},
url = {https://github.com/agileabhi/hindi-bpe-tokenizer}
}