--- 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.