Translation
Transformers
Safetensors
Chichewa
English
marian
text2text-generation
nyanja
chichewa
low-resource
domain-adaptation
warm-up
encoder-mlm
Instructions to use kelvinmbewe/nyanja_english_warmup with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kelvinmbewe/nyanja_english_warmup with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="kelvinmbewe/nyanja_english_warmup")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("kelvinmbewe/nyanja_english_warmup") model = AutoModelForSeq2SeqLM.from_pretrained("kelvinmbewe/nyanja_english_warmup", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- ny
|
| 4 |
+
- en
|
| 5 |
+
license: cc-by-4.0
|
| 6 |
+
library_name: transformers
|
| 7 |
+
pipeline_tag: translation
|
| 8 |
+
base_model: Helsinki-NLP/opus-mt-ny-en
|
| 9 |
+
tags:
|
| 10 |
+
- translation
|
| 11 |
+
- marian
|
| 12 |
+
- nyanja
|
| 13 |
+
- chichewa
|
| 14 |
+
- low-resource
|
| 15 |
+
- domain-adaptation
|
| 16 |
+
- warm-up
|
| 17 |
+
- encoder-mlm
|
| 18 |
+
model-index:
|
| 19 |
+
- name: nyanja_english_warmup
|
| 20 |
+
results: []
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# Nyanja → English Encoder Warm-Up Model
|
| 24 |
+
|
| 25 |
+
This is an **intermediate "warm-up" checkpoint**, not a finished translation system. It is
|
| 26 |
+
[`Helsinki-NLP/opus-mt-ny-en`](https://huggingface.co/Helsinki-NLP/opus-mt-ny-en) whose
|
| 27 |
+
**encoder** has undergone masked-language-model (MLM) adaptation on monolingual Nyanja
|
| 28 |
+
(Chichewa) text, with the decoder frozen. The goal is to adapt the encoder's understanding of
|
| 29 |
+
Nyanja before a downstream supervised fine-tuning stage on parallel data.
|
| 30 |
+
|
| 31 |
+
> **Important:** This model has only seen *monolingual* Nyanja during this stage. Monolingual
|
| 32 |
+
> adaptation does **not**, on its own, teach the Nyanja↔English mapping, so this checkpoint
|
| 33 |
+
> should **not** be expected to have higher translation quality (BLEU/chrF++) than the base
|
| 34 |
+
> model. It is intended to be **fine-tuned on parallel ny–en data** before evaluation or use.
|
| 35 |
+
|
| 36 |
+
## Model details
|
| 37 |
+
|
| 38 |
+
| | |
|
| 39 |
+
|---|---|
|
| 40 |
+
| Base model | `Helsinki-NLP/opus-mt-ny-en` (MarianMT) |
|
| 41 |
+
| Direction | Nyanja (Chichewa) → English |
|
| 42 |
+
| Warm-up objective | Encoder masked language modeling (mask 15%, predict masked tokens only) |
|
| 43 |
+
| Trainable | Encoder only — decoder frozen |
|
| 44 |
+
| Vocabulary | **59,812** (native 59,811 + one added `<mask>` token; embeddings resized) |
|
| 45 |
+
| Hidden size | 512 |
|
| 46 |
+
| Parameters | ~75M total (~19.2M trained) |
|
| 47 |
+
|
| 48 |
+
> **Vocab note / integration gotcha:** because MLM needs a mask token (MarianMT has none), a
|
| 49 |
+
> `<mask>` token was added and the embeddings resized to **59,812**. This model is therefore
|
| 50 |
+
> **not drop-in compatible** with a vanilla `opus-mt-ny-en` (59,811). When you fine-tune or load
|
| 51 |
+
> it downstream, use **this repo's tokenizer** so the sizes match.
|