Downloads · 30 days
247
32% of all-time downloads
francois-meyer/nguni-xlmr-large
nguni-xlmr-large is a fill-mask model from francois-meyer. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as mit.
Nguni-XLMR-large is a pretrained masked language model that adapts XLM-R-large for the Nguni languages - isiXhosa, isiZulu, isiNdebele, and Siswati - via multilingual continued pretraining. It outperforms base models…
Downloads · 30 days
247
32% of all-time downloads
All-time downloads
782
Public
Repo size
4.5 GB
Likes
1
Public
Click a slice to open those files.
.bin2.2 GB · 99%
From the Hugging Face model README
Nguni-XLMR-large is a pretrained masked language model that adapts XLM-R-large for the Nguni languages - isiXhosa, isiZulu, isiNdebele, and Siswati - via multilingual continued pretraining. It outperforms base models on natural language understanding tasks in the NGLUEni benchmark.
Paper: NGLUEni: Benchmarking and Adapting Pretrained Language Models for Nguni Languages
Francois Meyer, Haiyue Song, Abhisek Chakrabarty, Jan Buys, Raj Dabre and Hideki Tanaka
LREC-COLING 2024
tokenizer = AutoTokenizer.from_pretrained("francois-meyer/nguni-xlmr-large")
model = XLMRobertaForMaskedLM.from_pretrained("francois-meyer/nguni-xlmr-large")
text = "A test <mask> for the nguni model." ## Replace with any sentence from the Nguni Languages with mask tokens.
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]
predicted_token_id = logits[0, mask_token_index].argmax(axis=-1)
print(tokenizer.decode(predicted_token_id))
@inproceedings{meyer-etal-2024-nglueni,
title = "{NGLUE}ni: Benchmarking and Adapting Pretrained Language Models for Nguni Languages",
author = "Meyer, Francois and
Song, Haiyue and
Chakrabarty, Abhisek and
Buys, Jan and
Dabre, Raj and
Tanaka, Hideki",
editor = "Calzolari, Nicoletta and
Kan, Min-Yen and
Hoste, Veronique and
Lenci, Alessandro and
Sakti, Sakriani and
Xue, Nianwen",
booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
month = may,
year = "2024",
address = "Torino, Italia",
publisher = "ELRA and ICCL",
url = "https://aclanthology.org/2024.lrec-main.1071/",
pages = "12247--12258",
abstract = "The Nguni languages have over 20 million home language speakers in South Africa. There has been considerable growth in the datasets for Nguni languages, but so far no analysis of the performance of NLP models for these languages has been reported across languages and tasks. In this paper we study pretrained language models for the 4 Nguni languages - isiXhosa, isiZulu, isiNdebele, and Siswati. We compile publicly available datasets for natural language understanding and generation, spanning 6 tasks and 11 datasets. This benchmark, which we call NGLUEni, is the first centralised evaluation suite for the Nguni languages, allowing us to systematically evaluate the Nguni-language capabilities of pretrained language models (PLMs). Besides evaluating existing PLMs, we develop new PLMs for the Nguni languages through multilingual adaptive finetuning. Our models, Nguni-XLMR and Nguni-ByT5, outperform their base models and large-scale adapted models, showing that performance gains are obtainable through limited language group-based adaptation. We also perform experiments on cross-lingual transfer and machine translation. Our models achieve notable cross-lingual transfer improvements in the lower resourced Nguni languages (isiNdebele and Siswati). To facilitate future use of NGLUEni as a standardised evaluation suite for the Nguni languages, we create a web portal to access the collection of datasets and publicly release our models."
}