--- license: apache-2.0 base_model: Helsinki-NLP/opus-mt-en-mul language: - en - shi tags: - translation - shi - tatoeba datasets: - tatoeba library_name: transformers pipeline_tag: translation --- # English → Tachelhit (opus-mt finetune) Translates English into Tachelhit. Finetuned by [Linguardia](https://linguardia.com) from `Helsinki-NLP/opus-mt-en-mul` on the English↔Tachelhit sentence pairs in [Tatoeba](https://tatoeba.org). Built to generate course material for a language that no major machine translator supports. ## Usage ```python from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tok = AutoTokenizer.from_pretrained("linguardia/opus-mt-en-shi") model = AutoModelForSeq2SeqLM.from_pretrained("linguardia/opus-mt-en-shi") batch = tok([">>shi<< I wake up early."], return_tensors="pt") out = model.generate(**batch, num_beams=4, max_length=64) print(tok.batch_decode(out, skip_special_tokens=True)) ``` The target language is selected by the `>>shi<<` prefix on the source text. It was added as a **new** token rather than replacing one of the base model's existing languages, so every language the base already handled still works. ## Training | | | |---|---| | base | `Helsinki-NLP/opus-mt-en-mul` (77M params) | | training pairs | 20,399 | | held out | 1,000 dev, 31 gold | | epochs | 6.0 | | batch size | 32 | | optimiser | Adafactor, lr 5e-5, 500 warmup steps | | max sequence | 48 tokens (99.9% of source, 99.6% of target) | | hardware | Apple M4, MPS | ## Evaluation Held-out Tatoeba (1000 pairs never seen in training): | metric | score | |---|---| | BLEU | 31.0 | | chrF | 52.8 | Against 31 human translations of sentences that appear verbatim in the target corpus: | metric | score | |---|---| | BLEU | 37.2 | | chrF | 59.8 | Translating the same 2,000-sentence course corpus: | corpus | rows | distinct | vocab | words/sentence | |---|---|---|---|---| | this model | 2000 | 1998 (99.9%) | 2634 | 5.9 | ## Training data and attribution Sentence pairs come from **Tatoeba**, released under [CC-BY 2.0 FR](https://creativecommons.org/licenses/by/2.0/fr/), with some sentences under CC0 1.0. Tatoeba's sentences are written by volunteers, and this model is a derivative of their work: if you use it, credit Tatoeba and its contributors. Pairs were deduplicated on exact (English, Tachelhit) text. No machine translation was used to create the training data at any point. ## Licence chain | layer | licence | |---|---| | base model `Helsinki-NLP/opus-mt-en-mul` | Apache-2.0 | | training data (Tatoeba) | CC-BY 2.0 FR / CC0 1.0 | | these weights | Apache-2.0, with the attribution above | ## Limitations - Trained on Tatoeba, which is short everyday sentences. Expect it to be weakest on long, technical or literary text. - Neural MT translates each sentence independently, so a term may be rendered differently across a corpus. Check consistency if that matters to you. - Output should be reviewed by a speaker before being taught to learners.