Views
No views yet
initial+digit token that preserves the pinyin initial, a tone group, and a
syllable-length bucket — e.g. 我们 → W6M7. It is a lossy, phonology-first encoding.| Task | Score | vs 33.4M |
|---|---|---|
| ZhoBLiMP (acc) | 72.68 | +3.9 |
| Hanzi-structure (acc) | 55.00 | ~ |
| Hanzi-pinyin (acc) | 95.80 | +0.4 |
| AFQMC (acc) | 68.54 | ~ |
| OCNLI (acc) | 61.80 | +4.2 |
| TNEWS (acc) | 52.26 | +1.5 |
| CLUEWSC (acc) | 63.49 | +1.0 |
| word_fmri (corr) | 0.554 | ~ |
| fmri (corr) | 0.086 | ~ |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3name = "CPSPX/babylm-zho-pinyin-code-97M"
4model = AutoModelForCausalLM.from_pretrained(name, trust_remote_code=True)
5tokenizer = AutoTokenizer.from_pretrained(name, trust_remote_code=True)
6
7# The tokenizer auto-converts raw Mandarin into the pinyin-code representation:
8inputs = tokenizer("我们一起来看电影吧", return_tensors="pt")
9out = model.generate(**inputs, max_new_tokens=40)
10print(tokenizer.decode(out[0]))trust_remote_code=True is required — the architecture and the transliterating
tokenizer are custom. Source: https://github.com/tbhrobrecht/babylm-pinyin-abbreviations