mitra-bo-zh-tagger

A 9B-parameter model that turns raw classical Tibetan (Wylie) or raw, unpunctuated Buddhist Chinese into a full linguistic annotation in one pass:

  • sentence segmentation (one sentence per output line),
  • word segmentation at the dictionary-lexeme level (Tibetan) / Sanskrit-lemma level (Chinese),
  • a coarse part of speech on every word,
  • the words that together render one Sanskrit word or compound, bracketed (Chinese: with compound type),
  • for Chinese, punctuation restored (ใ€‚๏ผŒใ€๏ผš๏ผ›๏ผŸ๏ผ and quotation marks).

The model was trained by the MITRA project on top of the MITRA Qwen3.5-9B stage-2 base (Qwen3.5 architecture, continued pretraining on Buddhist Sanskrit, Tibetan, Chinese and parallel data). The convenient way to use it is the Python package dharmamitra/mitra-bo-zh-tagger, which handles chunking, Unicode/Wylie conversion, validation and conversion into structured records.

Input / output

Plain-text prompt (no chat template). The instruction line is fixed and must be given verbatim; the package's mitra_tagger.prompts module contains both strings.

<instruction>
TIBETAN: de nas tshe dang ldan pa kun dga' bos bcom ldan 'das la 'di skad ces gsol to/ /
OUTPUT:
[de_nas/A] [tshe_dang_ldan_pa/J] [kun_dga'_bo/P] +s/C [bcom_ldan_'das/N] la/C 'di_skad/A ces/L [gsol/V] to/L ||/p
<instruction>
CHINESE: ็ˆพๆ™‚ไธ–ๅฐŠๅ‘Š่ซธๆฏ”ไธ˜ๆฑ็ญ‰็•ถ็Ÿฅไธ€ๅˆ‡่ซธๆณ•็š†ๆ‚‰็„กๅธธ่‹ฆ็ฉบ็„กๆˆ‘่‹ฅ่ƒฝๅฆ‚ๆ˜ฏ่ง€่€…ๅ‰‡ๅพ—่งฃ่„ซ
OUTPUT:
็ˆพ/R ๆ™‚/N ไธ–ๅฐŠ/N ๅ‘Š/V ่ซธ/L ๆฏ”ไธ˜/N ๏ผš/p ใ€Œ/p ๆฑ/R ็ญ‰/L ็•ถ/X ็Ÿฅ/V ๏ผŒ/p [ไธ€ๅˆ‡/N ่ซธ/L ๆณ•/N]=K ็š†/A ๆ‚‰/A ็„กๅธธ/J ใ€/p ่‹ฆ/J ใ€/p ็ฉบ/J ใ€/p [็„ก/V ๆˆ‘/R]=B ใ€‚/p
่‹ฅ/S ่ƒฝ/X ๅฆ‚/V ๆ˜ฏ/R ่ง€/V ่€…/L ๏ผŒ/p ๅ‰‡/K ๅพ—/X ่งฃ่„ซ/V ใ€‚/p ใ€/p

Format: tokens WORD/POS, punctuation MARK/p, Sanskrit units [ ... ]. Tibetan syllables of one word are joined with _; an affix written attached in the input ('i, s, r, 'o, 'am, 'ang) becomes its own token +affix; shad runs become |/p or ||/p. Chinese units carry =T tatpuruแนฃa, =K karmadhฤraya, =D dvandva, =B bahuvrฤซhi, =A avyayฤซbhฤva, =O other.

Tibetan tags: N noun, P proper noun, V verb, G verbal noun, J adjective, A adverb, M numeral, R pronoun, D determiner/demonstrative/plural, X negation, C case particle, K clause particle, L clitic or final particle, I interjection, p punctuation. Chinese tags: N noun, P proper noun, V verb, J adjective, A adverb, R pronoun, M numeral, X auxiliary, C adposition, K coordinating conjunction, S subordinating conjunction, L particle, I interjection, p punctuation.

Input limits used in training: Tibetan sentences and paragraphs of a few sentences (targets up to ~1,000 characters of Wylie); Chinese windows of up to 200 characters. Longer texts should be chunked accordingly.

Quick start

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

m = "buddhist-nlp/mitra-bo-zh-tagger"
tok = AutoTokenizer.from_pretrained(m)
model = AutoModelForCausalLM.from_pretrained(m, dtype=torch.bfloat16, device_map="auto").eval()

from mitra_tagger.prompts import build_prompt   # pip install git+https://github.com/dharmamitra/mitra-bo-zh-tagger
prompt = build_prompt("่‹ฅ่ƒฝๅฆ‚ๆ˜ฏ่ง€่€…ๅ‰‡ๅพ—่งฃ่„ซ", "zh")
ids = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=1024, do_sample=False)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))

Or simply pip install git+https://github.com/dharmamitra/mitra-bo-zh-tagger and mitra-tag --lang zh file.txt. Runs on CUDA (bfloat16, ~19 GB), Apple Silicon (float16 via MPS, 24 GB+ unified memory) and CPU.

Quality

Held-out test set, 100 items per language, against Gemini-corrected gold annotations:

Tibetan Chinese
Word boundary F1 0.95 0.94
POS accuracy (matched words) 0.94 0.94
Sentence boundary F1 0.87 0.81
Punctuation position F1 โ€“ 0.79
Sanskrit unit / compound F1 0.65 0.52
Output reproduces input 99% 86%

Sanskrit-unit bracketing is the weakest layer (mostly under-marking). Chinese round-trip failures on 200-character windows are single-character slips; sentence-level input is more robust.

Limitations

The gold data is model-corrected, not human-checked. The model has seen Buddhist canonical text only; other registers of classical Chinese or Tibetan will degrade.

Citation

Please refer to the Dharmamitra project and this model card when using the tagger. Publication under preperation!

Downloads last month
144
Safetensors
Model size
9B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for buddhist-nlp/mitra-bo-zh-tagger

Finetuned
Qwen/Qwen3.5-9B
Finetuned
(1229)
this model