Practical overview
When it fits
Use Hazm when a Python project needs multiple Persian NLP stages, from normalization and tokenization through linguistic analysis or embeddings.
Who it is for
- Python developers building Persian text-processing pipelines
- Teams adding Persian linguistic analysis or embeddings to text applications
Documented uses
- Standardize Persian text, including diacritics and zero-width non-joiner usage.
- Split Persian text into sentences and words.
- Reduce words to base forms and assign part-of-speech tags.
- Identify phrase chunks and syntactic dependency relations.
- Create word and sentence embeddings or read popular Persian corpora.
Requirements & limits
The public repository specifies an MIT license. The README lists Python 3.12 or later as the installation requirement.
- Hazm is a library to use in Python projects, rather than a standalone text-analysis interface.
- Pretrained models are downloaded from Hugging Face; using them requires huggingface-hub and model identifiers.
- The repository reports evaluation results for selected modules, which may help assess components but do not establish performance for a reader's own data.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Hazm for a Persian text workflow
Install the library and prepare its documented pretrained-model dependency.
Before you start
- Python 3.12 or later
- pip
- The huggingface-hub package when using pretrained models
Steps
Install Hazm with pip install hazm.
For pretrained models, install huggingface-hub with pip install huggingface-hub.
Select a model repository ID and filename for the component you plan to use.
Expected outcome
Hazm and, if needed, its Hugging Face model-download dependency are installed; the README describes supplying model IDs and filenames for pretrained components.
Guide limitations
- The installation instructions do not constitute a run or deployment guide.
- A model repository ID and filename are needed to use pretrained models.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- roshan-research/hazm · Official homepage title · retained in its source language

