Downloads · 30 days
0
Om-7387/Hindi_Tokenizer
Hindi_Tokenizer is a token classification model from Om-7387. Use it when you need labels on individual words, such as names. The card lists the license as unknown.
This model card summarizes the Hindi tokenizer models produced from the training pipeline. The released artifacts include multiple tokenizer variants trained and evaluated on a Hindi corpus.
Downloads · 30 days
0
Access
Public
Updated Jul 4, 2026
Repo size
544 KB
Likes
0
Public
Click a slice to open those files.
.model544 KB · 73%
From the Hugging Face model README
This model card summarizes the Hindi tokenizer models produced from the training pipeline. The released artifacts include multiple tokenizer variants trained and evaluated on a Hindi corpus.
The tokenizers were trained on Hindi text derived from source documents and processed through the pipeline for corpus cleaning and subword discovery.
The following tokenizer artifacts were generated:
The evaluation report shows the following metrics for the trained tokenizers on 158,106 evaluated words:
| Tokenizer | Compression Ratio | Avg Tokens / Word | Coverage % | Unknown % |
|---|---|---|---|---|
| custom_bpe | 1.7228 | 3.7286 | 97.72 | 0.00 |
| phase2_subword_discovery | 6.4233 | 1.0000 | 99.97 | 0.00 |
| sentencepiece_bpe | 1.4024 | 4.5804 | 89.39 | 0.00 |
| sentencepiece_unigram | 1.3510 | 4.7544 | 86.42 | 0.00 |
You can test the trained tokenizer models with sample Hindi text using the following Python snippet:
from pathlib import Path
import sys
PROJECT_ROOT = Path(__file__).resolve().parent
sys.path.insert(0, str(PROJECT_ROOT))
from pipelines.phase3.bpe_trainer import BPEModel
from pipelines.phase3.sentencepiece_trainer import load_sentencepiece
def load_tokenizers():
phase3_dir = PROJECT_ROOT / "outputs" / "phase3"
custom_bpe = BPEModel.load(phase3_dir / "custom_bpe_model.json")
sp_bpe = load_sentencepiece(str(phase3_dir / "sentencepiece_bpe"))
sp_unigram = load_sentencepiece(str(phase3_dir / "sentencepiece_unigram"))
return custom_bpe, sp_bpe, sp_unigram
def tokenize_with_custom_bpe(model, samples):
results = []
for sample in samples:
words = sample.split()
tokens = []
for word in words:
tokens.extend(model.encode_word(word))
results.append(tokens)
return results
def tokenize_with_sentencepiece(sp, samples):
return [sp.encode(sample, out_type=str) for sample in samples]
sample_texts = [
"भारत",
"भारतीय संविधान",
"सरकार ने निर्णय लिया",
"मजदूरी और शिक्षा",
"विद्यालय में पढ़ाई होती है",
]
custom_bpe, sp_bpe, sp_unigram = load_tokenizers()
print("Custom BPE:")
for sample, tokens in zip(sample_texts, tokenize_with_custom_bpe(custom_bpe, sample_texts)):
print(f"{sample} -> {tokens}")
print("\nSentencePiece BPE:")
for sample, tokens in zip(sample_texts, tokenize_with_sentencepiece(sp_bpe, sample_texts)):
print(f"{sample} -> {tokens}")
print("\nSentencePiece Unigram:")
for sample, tokens in zip(sample_texts, tokenize_with_sentencepiece(sp_unigram, sample_texts)):
print(f"{sample} -> {tokens}")