Instructions to use rmacario/nhengatu-experiments with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rmacario/nhengatu-experiments with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rmacario/nhengatu-experiments", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Cross-Lingual Transfer: Portuguese → Nheengatu (experiments)
Models, embeddings, and results from a study of cross-lingual transfer between
Portuguese (pt) and Nheengatu (yrl), a Tupian language of the Brazilian
Amazon. Four methods are tested at increasing linguistic depth (Word2Vec,
fastText, Procrustes alignment, and fine-tuned XLM-RoBERTa), plus a
Portuguese-vs-Spanish source-language control.
Repository contents
| Folder | Contents |
|---|---|
01_word2vec |
Word2Vec embeddings and analysis |
02_fasttext |
fastText (subword) embeddings |
03_crosslingual |
XLM-R fine-tuning, Procrustes alignment, and the PT-vs-ES control (scripts + results) |
05_visualization |
Figures (PCA, semantic fields) |
06_typological_analysis |
URIEL/typological distance analysis |
results |
Aggregated result files |
Corpus
4,997 cleaned Portuguese–Nheengatu sentence pairs (5,028 before filtering) from four sources:
| Source | Register | Pairs |
|---|---|---|
| Brazilian Constitution translated into Nheengatu | legal | 2,020 |
| Navarro, Curso de Língua Geral | pedagogical | 2,139 |
| Tycho Brahe historical fragments | historical | 597 |
| Casasnovas, Noções de língua geral | grammatical | 241 |
| Total (cleaned) | 4,997 |
Navarro's pedagogical grammar and Casasnovas's grammatical notes were both obtained via the CompLin/nheengatu repository (Alencar, 2023); the Tycho Brahe fragments come from the Tycho Brahe corpus (Veronesi, 2026).
Results
Cross-lingual sentence retrieval, fine-tuned xlm-roberta-base, on a 1,000-pair
held-out test set:
| Metric | Score |
|---|---|
| Precision@1 | 0.247 |
| Precision@5 | 0.504 |
| Precision@10 | 0.621 |
| MRR | 0.371 |
By domain (P@1): Tycho 0.387 · Constitution 0.252 · Navarro 0.218 · Casasnovas 0.057
Source-language control
To test whether the advantage is contact-specific rather than generic multilingual behaviour, Portuguese is compared against Spanish — typologically near-identical but without comparable contact history — under identical fine-tuning across 5 seeds:
| Metric | PT (contact) | ES (control) | Gap |
|---|---|---|---|
| P@1 | 0.281 ± 0.012 | 0.232 ± 0.005 | +0.050 |
| P@5 | 0.545 ± 0.034 | 0.453 ± 0.009 | +0.091 |
| P@10 | 0.673 ± 0.030 | 0.568 ± 0.006 | +0.104 |
| MRR | 0.406 ± 0.018 | 0.340 ± 0.006 | +0.066 |
Portuguese wins on every metric across all 5 seeds. Because the Spanish set is machine-translated from the Portuguese source, the gap is a conservative estimate of the contact-specific advantage.
Related
- Fine-tuned model: https://huggingface.co/rmacario/nhengatu-xlmr
- Code: https://github.com/rmaacario/nheengatu-crosslingual
Citation
@inproceedings{fernandes2026nheengatu,
author = {Fernandes, Rafael Macário},
title = {Cross-Lingual Transfer from Portuguese to Nheengatu: Contact-Induced Convergence as a Computational Bridge},
booktitle = {Proceedings of LaTeLL 2026},
year = {2026}
}
License
CC BY 4.0 — Rafael Macário Fernandes.
Model tree for rmacario/nhengatu-experiments
Base model
FacebookAI/xlm-roberta-base