Translation
Transformers
ONNX
Safetensors
Spanish
Zapotec
m2m_100
text2text-generation
nllb
zapotec
diidxaza
low-resource
zai
Juchitan
translator
oaxaca
Machine
lora
facebook
finetuned
Instructions to use simpleverso/espzap-nllb-600m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use simpleverso/espzap-nllb-600m 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="simpleverso/espzap-nllb-600m")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("simpleverso/espzap-nllb-600m") model = AutoModelForSeq2SeqLM.from_pretrained("simpleverso/espzap-nllb-600m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 2,746 Bytes
afeb730 3360d29 be82f97 afeb730 59b04c1 afeb730 59b04c1 afeb730 62246cb afeb730 d40e333 a7141c1 d40e333 a7141c1 ebda520 afeb730 c3f61cc afeb730 be82f97 ebda520 afeb730 ebda520 fc26a26 afeb730 fc26a26 b31e1c0 90de978 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ---
license: cc-by-nc-4.0
language:
- es
- zap
pipeline_tag: translation
tags:
- translation
- nllb
- zapotec
- diidxaza
- low-resource
- zai
- Juchitan
- translator
- oaxaca
- Machine
- lora
- facebook
- finetuned
base_model: facebook/nllb-200-distilled-600M
library_name: transformers
---
# Spanish → Isthmus Zapotec (Diidxazá) Experimental translator
Neural machine translation from Spanish (`spa_Latn`) into Isthmus Zapotec
(Diidxazá), built by LoRA fine-tuning,
[`facebook/nllb-200-distilled-600M`](https://huggingface.co/facebook/nllb-200-distilled-600M)
and merging the adapter back into the base for a standalone model.
Isthmus Zapotec is not covered by any pretrained MT model, so an existing NLLB
language slot (`ayr_Latn`) is reused as the Zapotec output tag. Every training
target is Zapotec, so the model fully repurposes that tag. The forced target tag
is stored in `generation_config.json` (`forced_bos_token_id`), so generation
needs no special setup.
This is a side result of the main project called Didxazapp.
## Usage
```python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_id = "simpleverso/espzap-nllb-600m"
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
tok = AutoTokenizer.from_pretrained(model_id, src_lang="spa_Latn")
def generate_text(text: str) -> str:
inputs = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, num_beams=4, max_length=96)
return tok.batch_decode(out, skip_special_tokens=True)[0]
generate_text("quiero ver tu risa todo el dia")
```
You can use the onnx version of the model directly in your browser here:
https://huggingface.co/spaces/simpleverso/espzap-translator
## Results
Trained on 18,452 unique parallel pairs.
| Metric | Dev (best epoch) | Test (held-out) |
|---|---|---|
| chrF | 42.1 | 37.7 |
| BLEU | 9.7 | 6.4 |
## Models output:
- Safetensor
- Onnx
## Limitations
- Trained on ~18.5k pairs; usable but imperfect. There is no standarized zapotec information, Im working to build one.
- Part of the training data is unreviewed, so some outputs may
reflect noise in that source.
- Handles everyday sentences best; long or highly literary input degrades.
## License
The base model NLLB-200 is released under CC-BY-NC-4.0; this derivative inherits
that non-commercial license.
## Author
Gonzalo Santiago Martinez
## Disclaimer:
Any translation is provided for convenience only. The author makes no warranty of any kind, express or implied, as to the accuracy, reliability, or correctness of any translations. Any reliance on the translated text is at the user's own risk. The author are not liable for any harm, loss, or damage resulting from the use of or reliance on this translation tool. |