Skip to main content

Uzbek MWE Tokenizer (uzbek-mwe-tokenizer)

PyPI version Python Tests PyPI Downloads License: MIT Python Hugging Face

uzbek-mwe-tokenizer (UzbekMWETokenizer) is an open-source Python library for Transformer-based Multi-Word Expression (MWE) identification in Uzbek language texts. It is built on a fine-tuned UzBERT model (MaksudSharipov/Uzbek-MWE-Tokenizer-uzBERT) and extracts idiomatic expressions, auxiliary verb constructions, compound verbs, and compound nouns in context.

Cross-script MWE identification workflow

Main Features

  • Transformer-based MWE identification (B-MWE, I-MWE, O) for Uzbek texts.
  • Fine-tuned 108.5M-parameter UzBERT model for contextual MWE boundary prediction.
  • Cross-script support for both Latin (mode="lot") and Cyrillic (mode="cyr") Uzbek alphabets.
  • Smart Unicode apostrophe standardization (’, ‘, ````, ´, `ʼ`, `ʻ` $\rightarrow$ `'`), punctuation-decoupled lexical pre-tokenization, and monographemic Cyrillic projection to prevent subword fragmentation.
  • Subword-to-word alignment via word_ids(), safe sequence truncation (max_length=512), and phrase-level Softmax confidence scoring (round(avg_score, 2)).
  • Public distribution through PyPI (1,411+ cumulative downloads; 207 in the last 30 days) and Hugging Face Hub (146+ all-time model downloads; 18 in the last 30 days).

Installation

Install the package from PyPI (Python >= 3.8):

pip install uzbek-mwe-tokenizer

For development installation from GitHub:

git clone https://github.com/MaksudSharipov/uzbek-mwe-tokenizer.git
cd uzbek-mwe-tokenizer
pip install -r requirements.txt
pip install -e .

Quick Start

1. Latin Mode (mode="lot")

The package automatically standardizes apostrophes, projects Latin text to Cyrillic for monographemic inference, and restores extracted MWEs back to Latin:

from uzbek_mwe_tokenizer import UzbekMWETokenizer

tokenizer_lot = UzbekMWETokenizer(mode="lot")
text_lat = "Natijani ko'rib, hamma o'quvchilarning birdaniga tarvuzi qo'ltig'idan tushdi."
print(tokenizer_lot.extract_mwe(text_lat))

Output:

[{'mwe': "tarvuzi qo'ltig'idan tushdi", 'confidence': 99.98}]

2. Cyrillic Mode (mode="cyr")

from uzbek_mwe_tokenizer import UzbekMWETokenizer

tokenizer_cyr = UzbekMWETokenizer(mode="cyr")
text_cyr = "Қоронғи хонада унинг қаттиқ капалаги учди, гўё ерга кирса, қулоғидан тортиб чиқарадиган ҳолат эди."
print(tokenizer_cyr.extract_mwe(text_cyr))

Output:

[
    {'mwe': 'капалаги учди', 'confidence': 99.99},
    {'mwe': 'ерга кирса', 'confidence': 76.42},
    {'mwe': 'қулоғидан тортиб чиқарадиган', 'confidence': 98.08}
]

Model Performance (benchmark/)

Evaluated on an isomorphic Latin–Cyrillic Uzbek MWE corpus (11,936 sentences, 108,200 tokens, and 14,285 MWEs):

Model Architecture Script Accuracy Precision Recall F1-Score
BERTbek-News Latin 0.9602 0.8632 0.9011 0.8817
UzRoBERTa-v2 Latin 0.9582 0.8659 0.8947 0.8801
mBERT-Cased Latin 0.9531 0.8619 0.8954 0.8783
XLM-RoBERTa Latin 0.9568 0.8591 0.8919 0.8752
UzBERT-Uncased (uzbek-mwe-tokenizer) Cyrillic 0.9559 0.8528 0.8926 0.8722
Tahrirchi-BERT Latin 0.9541 0.8597 0.8834 0.8714

Testing & Benchmarking

Run the unit and integration test suite with pytest:

pytest tests -v

Run evaluation and inference-speed benchmarks:

python benchmark/evaluate.py --test-file path/to/test.conll --output benchmark/eval_summary.csv
python benchmark/speed_test.py

Repository Structure

uzbek-mwe-tokenizer/
├── README.md
├── LICENSE
├── CITATION.cff
├── RELEASE_NOTES_v0.1.1.md
├── pyproject.toml
├── setup.py
├── requirements.txt
├── test_examples.py
├── uzbek_mwe_tokenizer/
│   ├── __init__.py
│   └── tokenizer.py
├── examples/
│   ├── basic_usage.py
│   └── batch_extraction.py
├── tests/
│   ├── test_tokenizer.py
│   ├── test_import.py
│   └── test_model_integration_optional.py
├── benchmark/
│   ├── evaluate.py
│   ├── speed_test.py
│   ├── results.csv
│   └── README.md
├── docs/
│   ├── figure1_mwe_algorithm.png
│   ├── installation.md
│   ├── usage.md
│   └── tagset.md
└── paper/
    └── SOFTWARE_IMPACTS_MANUSCRIPT.md

Citation

If you use this software or model in your research or project, please cite both the software package and the foundational MWE study:

@software{sharipov2026uzbekmwetokenizer,
  title   = {UzbekMWETokenizer: A Python library for Transformer-based multi-word expression identification in Uzbek},
  author  = {Sharipov, Maksud and Saidov, Abdusobir and Ruzmetov, Azizbek and Bekchanov, Shukurla and Sobirov, Ogabek and Sattarova, Surayyo},
  year    = {2026},
  version = {0.1.1},
  license = {MIT},
  url     = {https://github.com/MaksudSharipov/uzbek-mwe-tokenizer}
}

@article{sharipov2026mwe,
  title   = {Transformer-based intelligent model for identifying multi-word lexical units and reducing syntactic ambiguities in Uzbek language texts},
  author  = {Sharipov, Maksud S.},
  journal = {Bulletin of TUIT: Management and Communication Technologies},
  volume  = {2},
  number  = {14},
  pages   = {103--107},
  year    = {2026},
  doi     = {10.61663/262tuitmct14}
}

Authors

  • Maksud Sharipov (Corresponding Author — Urgench State University & Tashkent University of Information Technologies; ORCID)
  • Abdusobir Saidov (Tashkent University of Information Technologies)
  • Azizbek Ruzmetov (Kimyo International University in Tashkent)
  • Shukurla Bekchanov (Mamun University)
  • Ogabek Sobirov (Tashkent State University of Economics; ORCID)
  • Surayyo Sattarova (RANCH University of Technology)

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for uzbek-mwe-tokenizer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uzbek-mwe-tokenizer 0.1.1
File Size Uploaded Provenance Actions
uzbek_mwe_tokenizer-0.1.1.tar.gz 13.6 kB Without provenance Details for uzbek_mwe_tokenizer-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uzbek-mwe-tokenizer 0.1.1
File Interpreter ABI Platform Actions
uzbek_mwe_tokenizer-0.1.1-py3-none-any.whl Python 3 none any Details for uzbek_mwe_tokenizer-0.1.1-py3-none-any.whl

Total release size: 21.5 kB

Release files / uzbek_mwe_tokenizer-0.1.1.tar.gz

Download URL uzbek_mwe_tokenizer-0.1.1.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1b4bdd0da1530f9fdae40ec02a1f93137ac12ddf7c9cbcde82415f16a2c71a74
BLAKE2b-256 checksum
How to use checksums
c2a427654eefc2e3b1fb57c33c492e26ddcc96be184cfe0ff88c83a40cd0fd71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release files / uzbek_mwe_tokenizer-0.1.1-py3-none-any.whl

Download URL uzbek_mwe_tokenizer-0.1.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1aeccf9360a6c2007e4790d5757fbcbd9d392ecd692f4476479df1843230016c
BLAKE2b-256 checksum
How to use checksums
7ea5bbd83f8e2aaebcf68c37c260653fc577b6b8a6fec9b201c79fc7ec4d826c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Security for uzbek-mwe-tokenizer 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page