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!