Downloads · 30 days
0
chagatai-project/chagatai-sentence-segmentation
chagatai-sentence-segmentation is a token classification model from chagatai-project. Use it when you need labels on individual words, such as names. It is set up for stanza. The card lists the license as mit.
Neural Sentence Boundary Detection (SBD) models for Chagatai (Chaghatay / جغتای), a classical Turkic literary language written in Perso-Arabic script, based on the Stanford Stanza tokenization and Character Language M…
Downloads · 30 days
0
Access
Public
Updated Sep 29, 2026
Repo size
214 MB
Likes
0
Public
Click a slice to open those files.
.onnx214 MB · 100%
From the Hugging Face model README
Neural Sentence Boundary Detection (SBD) models for Chagatai (Chaghatay / جغتای), a classical Turkic literary language written in Perso-Arabic script, based on the Stanford Stanza tokenization and Character Language Model (CharLM) architecture.
Classical Chagatai texts (e.g., Babur's Baburnama, Navoi's works) were written without modern punctuation (no periods, question marks, or exclamation marks). Robust sentence boundary detection is the primary prerequisite for subsequent NLP tasks: dependency parsing, machine translation, corpus analysis, and LLM pre-training.
All models are compiled into single, self-contained ONNX files with in-graph soft-voting ensembles and dynamic quantization, requiring zero PyTorch or Stanza dependencies at inference time.
Evaluated on the out-of-sample Chagatai test set (295 paragraphs, 71,673 character tokens, 868 true sentence boundaries):
| Model | Type | Training Dataset | Format | Size | F1 | Precision | Recall | Exact Match | Key Benefit |
|---|---|---|---|---|---|---|---|---|---|
| Tri-Hybrid [Stanza] | Ensemble (3 models) | Chagatai + Uyghur + S. Uzbek (balanced + only) | FP32 | 53.3 MB | 74.80% | 79.95% | 70.28% | 27.46% (81/295) | Best F1 & Precision (lowest false positives) |
| Tri-Hybrid [Stanza] | Ensemble (3 models) | Chagatai + Uyghur + S. Uzbek (balanced + only) | INT8 | 13.5 MB | 74.71% | 79.74% | 70.28% | 27.12% (80/295) | ~4x compressed, loss of only 0.09% F1 |
| BiCharLM [Stanza] | Ensemble (3 models) | Chagatai + Uyghur + S. Uzbek (balanced + CharLM) | FP32 | 82.8 MB | 74.59% | 79.17% | 70.51% | 27.80% (82/295) | Highest Exact Match record |
| BiCharLM [Stanza] | Ensemble (3 models) | Chagatai + Uyghur + S. Uzbek (balanced + CharLM) | INT8 | 26.0 MB | 74.42% | 78.94% | 70.39% | 27.80% (82/295) | 3.2x compressed, 100% EM preserved |
| Standalone [Stanza] | Single Model | Chagatai + Uyghur + S. Uzbek (balanced + CharLM) | FP32 | 29.2 MB | 71.94% | 71.09% | 72.81% | 22.37% (66/295) | Fastest single model (no ensemble) |
Each ONNX artifact bundles its entire multi-model pipeline into a single execution graph:
chagatai_sbd_tri_hybrid_stanza.onnx / INT8)[1/3, 1/3, 1/3] and calibrated threshold tau = 0.42.FwdCharLM_Wide3
chagatai_uzs_uyghur_balanced (train split: Chagatai + South Uzbek + Uyghur) + unannotated Chagatai text for CharLM.Only_Deep2
chagatai_only (pure historical Chagatai corpus without modern cross-lingual mixing).Weighted_Balanced
chagatai_uzs_uyghur_balanced.pos_weight = 4.0) + Hierarchical BiLSTM.chagatai_sbd_bicharlm_em_stanza.onnx / INT8)[1/3, 1/3, 1/3], calibrated threshold tau = 0.43.FwdCharLM_Wide3
chagatai_uzs_uyghur_balanced + unannotated Chagatai CharLM text.Weighted_Balanced
chagatai_uzs_uyghur_balanced.pos_weight = 4.0).BiCharLM_Weighted
chagatai_uzs_uyghur_balanced + unannotated Chagatai CharLM text.pos_weight = 4.0) + Hierarchical BiLSTM.chagatai_sbd_fwd_charlm_stanza.onnx)chagatai_uzs_uyghur_balanced + unannotated Chagatai CharLM text.tau = 0.24.The models were trained on the unified dataset builds from the Chagatai Sentence Segmentation project:
chagatai_only:
chagatai_uzs_uyghur_balanced:
uzs) and Uyghur (uyg).CharLM Unsupervised Corpus:
| File | Type | Format | Size | Threshold | Recommended For |
|---|---|---|---|---|---|
chagatai_sbd_tri_hybrid_stanza.onnx | Ensemble (3 models) | FP32 | 53.3 MB | tau = 0.42 | Highest F1 score and precision |
chagatai_sbd_tri_hybrid_stanza_int8.onnx | Ensemble (3 models) | INT8 | 13.5 MB | tau = 0.42 | Ultra-lightweight production deployment (~4x smaller) |
chagatai_sbd_bicharlm_em_stanza.onnx | Ensemble (3 models) | FP32 | 82.8 MB | tau = 0.43 | Highest paragraph-level exact match (27.80%) |
chagatai_sbd_bicharlm_em_stanza_int8.onnx | Ensemble (3 models) | INT8 | 26.0 MB | tau = 0.43 | Compact exact-match ensemble (3.2x smaller) |
chagatai_sbd_fwd_charlm_stanza.onnx | Single Model | FP32 | 29.2 MB | tau = 0.24 | Maximum throughput (single model) |
vocab.json | Vocabulary | JSON | 2.4 KB | — | 80-unit Perso-Arabic character mapping |
inference.py | Engine | Python | 5.2 KB | — | Zero-dependency standalone inference script |
No PyTorch, Transformers, or Stanza required. All you need is onnxruntime and numpy:
pip install onnxruntime numpy huggingface_hub
from huggingface_hub import hf_hub_download
import importlib.util
REPO = "chagatai-project/chagatai-sentence-segmentation"
# 1. Download model, vocabulary, and inference script (using lightweight 13.5 MB INT8 model)
model_path = hf_hub_download(repo_id=REPO, filename="chagatai_sbd_tri_hybrid_stanza_int8.onnx")
vocab_path = hf_hub_download(repo_id=REPO, filename="vocab.json")
code_path = hf_hub_download(repo_id=REPO, filename="inference.py")
# 2. Load inference engine
spec = importlib.util.spec_from_file_location("inference", code_path)
inf = importlib.util.module_from_spec(spec)
spec.loader.exec_module(inf)
# 3. Initialize detector
sbd = inf.ChagataiSBD(model_path=model_path, vocab_path=vocab_path)
# 4. Segment historical Chagatai text (Baburnama)
text = "سلطان ابوسعید میرزا شهادت تاپقاندین سونگ سمرقند ولایتینی میرزا احمد آلدی و هرات ولایتینی سلطان حسین میرزا ضبط قیلدی و اندیجان ولایتینی عمرشیخ میرزا توتتی"
sentences = sbd.segment(text)
for idx, sent in enumerate(sentences, 1):
print(f"[{idx}] {sent}")
Output:
[1] سلطان ابوسعید میرزا شهادت تاپقاندین سونگ سمرقند ولایتینی میرزا احمد آلدی
[2] و هرات ولایتینی سلطان حسین میرزا ضبط قیلدی
[3] و اندیجان ولایتینی عمرشیخ میرزا توتتی
If you use these models or datasets in your research, please cite the underlying sources:
chg): Original historical texts sourced from KazCorpus / QazCorpora (National Corpus of the Kazakh Language), containing the manuscript Shajara-i Turk (Genealogy of the Turks) by Abu al-Ghazi Bahadur Khan (17th c.).uzs): Auxiliary data sourced from the Hugging Face dataset tahrirchi/lutfiy (Tahrirchi, "Filling the Gap for Uzbek: Creating Translation Resources for Southern Uzbek", arXiv:2508.14586).