Downloads · 30 days
0
adityaghai07/ag_hindi_uni_tokenizer_32k
ag_hindi_uni_tokenizer_32k is a machine learning model from adityaghai07. 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 sentencepiece. The card lists the license as mit.
Unigram language model tokenizer for Hindi (Devanagari script) using SentencePiece. Trained on Hindi Wikipedia.
Downloads · 30 days
0
Access
Public
Updated Mar 15, 2026
Repo size
1.1 MB
Likes
0
Public
Click a slice to open those files.
.model1.1 MB · 54%
From the Hugging Face model README
Unigram language model tokenizer for Hindi (Devanagari script) using SentencePiece. Trained on Hindi Wikipedia.
Fertility ~1.8-2.0 tokens/word. Probabilistic tokenization supports subword regularization during training.
import sentencepiece as spm
sp = spm.SentencePieceProcessor()
sp.Load("hindi_unigram.model")
tokens = sp.EncodeAsPieces("भारत एक महान देश है।")
ids = sp.EncodeAsIds("भारत एक महान देश है।")
print(sp.DecodeIds(ids))
from huggingface_hub import hf_hub_download
import sentencepiece as spm
model_path = hf_hub_download(
repo_id="adityaghai07/ag_hindi_uni_tokenizer_32k",
filename="hindi_unigram.model"
)
sp = spm.SentencePieceProcessor()
sp.Load(model_path)