Views
No views yet
ton_Latn (scratch init — the token-init comparison in the experiment
showed the init method makes no measurable difference at an adequate
learning rate).1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
2
3model = AutoModelForSeq2SeqLM.from_pretrained("DavidCBaines/ebible_m2o-nllb600m-ton")
4tokenizer = AutoTokenizer.from_pretrained("DavidCBaines/ebible_m2o-nllb600m-ton")
5
6tokenizer.src_lang = "mri_Latn" # any source language's FLORES code
7batch = tokenizer(["<a mri verse>"], return_tensors="pt")
8out = model.generate(
9 **batch,
10 forced_bos_token_id=tokenizer.convert_tokens_to_ids("ton_Latn"),
11 num_beams=5, max_length=128,
12)
13print(tokenizer.batch_decode(out, skip_special_tokens=True)[0])forced_bos_token_id is also baked into generation_config.json, so
omitting it works too.| book | verses | best source | chrF3 | spBLEU | mean chrF3 over sources | source-copy floor |
|---|---|---|---|---|---|---|
| RUT | 85 | mri | 46.59 | 32.67 | 45.58 | 20.21 |
| JON | 48 | tgl | 46.78 | 33.61 | 45.66 | 18.74 |
| GEN 1: | 31 | ind | 48.5 | 33.31 | 47.07 | 18.57 |
cc-by-nc-sa-4.0.| translation | language | FLORES code | licence |
|---|---|---|---|
ton | ton (target) | — | Public Domain |
mri2012 | mri | mri_Latn | by-nc |
indayt | ind | ind_Latn | by-nc |
cebulb | ceb | ceb_Latn | by-sa |
tglulb | tgl | tgl_Latn | by-sa |
m2o_ton, init scratch, lr 0.0003, max
8000 steps, generation-based early stopping
(chrF3 on a fixed 250-verse NT set, patience 3, min-delta 0.2).423a6b234f489c111f6d44f0e45b53d621d8d720