Instructions to use uzbtrust/uzbek-morpheme-byt5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use uzbtrust/uzbek-morpheme-byt5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="uzbtrust/uzbek-morpheme-byt5")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("uzbtrust/uzbek-morpheme-byt5") model = AutoModelForSeq2SeqLM.from_pretrained("uzbtrust/uzbek-morpheme-byt5", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use uzbtrust/uzbek-morpheme-byt5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "uzbtrust/uzbek-morpheme-byt5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "uzbtrust/uzbek-morpheme-byt5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/uzbtrust/uzbek-morpheme-byt5
- SGLang
How to use uzbtrust/uzbek-morpheme-byt5 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "uzbtrust/uzbek-morpheme-byt5" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "uzbtrust/uzbek-morpheme-byt5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "uzbtrust/uzbek-morpheme-byt5" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "uzbtrust/uzbek-morpheme-byt5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use uzbtrust/uzbek-morpheme-byt5 with Docker Model Runner:
docker model run hf.co/uzbtrust/uzbek-morpheme-byt5
UZ-ByT5: Uzbek Morpheme Segmentation
UZ-ByT5 is a fine-tuned byte-level sequence-to-sequence model for explainable Uzbek morpheme analysis. Given a surface word, it restores the lexical root and labels each morpheme as a root, derivational, lexical-forming or syntactic-forming unit.
The complete hybrid application, rule-based fallback and evaluation code are
available at
uzbtrust/uzbek-morpheme-analyzer.
Output format
The model generates space-separated form=TAG tokens:
| Tag | Meaning |
|---|---|
A |
root / asos |
D |
derivational morpheme / so‘z yasovchi |
L |
lexical-forming morpheme / lug‘aviy shakl yasovchi |
S |
syntactic-forming morpheme / sintaktik shakl yasovchi |
Examples:
o‘g‘limda → o‘g‘il=A im=S da=S
yozdirilgan → yoz=A dir=D il=L gan=L
kitoblarimizdan → kitob=A lar=L imiz=S dan=S
Usage
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
repo_id = "uzbtrust/uzbek-morpheme-byt5"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSeq2SeqLM.from_pretrained(repo_id).eval()
word = "kitoblarimizdan"
inputs = tokenizer([word], return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=96)
print(tokenizer.batch_decode(output, skip_special_tokens=True)[0])
For production use, validate that generated parts reconstruct the source word and combine the model with the rule-based fallback in the GitHub project.
Training
- Base model:
google/byt5-small - Task: surface word → labeled morpheme sequence
- Training set: approximately 246K generated Uzbek forms
- Validation: 3,000 held-out generated forms
- Compute: Kaggle T4 GPU
- Epochs: 8
- Precision: fp32
The generator applies forward Uzbek morphophonological rules, including consonant alternation, vowel deletion and consonant insertion. This allows the model to learn inverse restoration such as:
o‘g‘lim → o‘g‘il
shahri → shahar
eshigi → eshik
tuprog‘i → tuproq
Evaluation
The best validation exact-match score recorded during training was 98.77% on the 3,000 generated held-out forms.
This is a synthetic-data validation score, not a universal benchmark for Uzbek. The accompanying project also includes 28 manually curated regression words and 31 unit tests for its hybrid inference pipeline.
Intended use
Suitable for:
- Uzbek linguistic education and explainable word analysis;
- morphology-aware NLP prototypes;
- lexicographic or annotation assistance;
- research on low-resource Turkic morphology.
The model should not be treated as an authoritative linguistic source without human review.
Limitations
- trained primarily on generated isolated words rather than running text;
- ambiguous suffixes may require sentence context;
- proper names, new borrowings and dialectal forms may be out of distribution;
- the raw output provides coarse morpheme classes; the application adds grammatical function, descriptions and examples deterministically.
License and attribution
The checkpoint is derived from google/byt5-small, distributed under Apache
License 2.0. Training vocabulary and runtime resources include separately
licensed third-party sources; see the
project notices.
- Downloads last month
- 35
Model tree for uzbtrust/uzbek-morpheme-byt5
Base model
google/byt5-small