Downloads · 30 days
0
PersianML/persian-gemma-tokenizer-fast
persian-gemma-tokenizer-fast is a machine learning model from PersianML. 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 fine-tuned Gemma tokenizer on Persian text, optimized to handle the nuances of the Persian language with improved efficiency and accuracy. This tokenizer is available via the Hugging Face Hub as mshojaei77/PersianGe…
Downloads · 30 days
0
Access
Public
Updated Jul 22, 2026
Repo size
4.2 MB
Likes
0
Public
Click a slice to open those files.
.model4.2 MB · 55%
From the Hugging Face model README
A fine-tuned Gemma tokenizer on Persian text, optimized to handle the nuances of the Persian language with improved efficiency and accuracy. This tokenizer is available via the Hugging Face Hub as mshojaei77/PersianGemmaTokenizerFast.
The PersianGemmaTokenizerFast leverages the robust architecture of the original Gemma tokenizer and is fine-tuned on Persian data. It is designed to provide faster and more accurate tokenization for various Natural Language Processing (NLP) tasks involving Persian text.
Here is an example of how to use the tokenizer in your Python code:
from transformers import AutoTokenizer
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("mshojaei77/PersianGemmaTokenizerFast")
# Example Persian text
text = "سلام، حال شما چطور است؟"
# Tokenize the text
encoded = tokenizer(text)
# Print token IDs and tokens
print("Token IDs:", encoded["input_ids"])
print("Tokens:", tokenizer.convert_ids_to_tokens(encoded["input_ids"]))
The following image compares the performance of the PersianGemmaTokenizerFast on a paragraph of Persian text, showcasing its efficiency relative to other tokenizers (fewer tokens imply better performance):

Contributions to improve the tokenizer or its documentation are welcome! If you encounter any issues or have suggestions, please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.