--- pipeline_tag: fill-mask language: - mda - nin - odu - abn - ego - kyq - bdh - eka - bza - bfa - aha - box - wbi - mwe - asa - bem - beq - bez - bxk - cce - chw - cjk - cwe - dav - dhm - dig - diu - dug - ebu - eko - fip - flr - gog - guz - gwr - hay - jit - jmc - kam - kck - kdc - kde - kdn - kik - kin - kiz - kki - kmb - kng - koo - kqn - ksb - kua - kuj - kwn - lai - lam - lgm - lik - mck - mer - mgh - mgq - mgr - mgw - mws - myx - nba - nbl - ndc - nde - ndh - ndj - ndo - ngl - ngo - ngp - nih - nim - nka - nnq - nse - nso - nuj - nya - nyd - nyf - nyk - nym - nyn - nyo - nyu - nyy - poy - rag - rim - rnd - rng - rub - run - rwk - sbp - sbs - sby - sna - sng - sop - sot - ssw - suk - swa - swc - swh - swk - sxb - thk - tke - tlj - tog - toh - toi - tsc - tsn - tso - ttj - tum - umb - ven - vid - vif - vmk - vmw - vun - wmw - xho - xog - yao - yom - zaj - zdj - zga - ziw - zul - mwn - loz - lsm - lto - lua - lue - lug - lun - lwg - dwr - gmv - gof - wal - bci - cko - fat - nzi - sfw - twi - heh - her - pem - pkb - dib - dik - dip - dks - nus - dow - kmy - gkn - ogo - kqy - fuh - fuq - fuv - fub - gna - kbp - kdh - lee - mzw - nnw - ntr - sig - sil - tpm - xsm - vag - acd - naw - ncu - nko - idu - ige - yba - bqj - csk - jib - nnb - kln - pko - krx - kia - cme - akp - lef - lip - snw - kdj - lot - mas - saq - teo - tuv - adh - alz - anu - kdi - laj - lth - luo - lwo - mfz - shk - ach - mpe - mcu - bam - dyu - knk - msc - mfg - mnk - nza - kbn - kzr - tui - xuo - men - bex - mgc - bcn - mzm - agq - azo - bav - bbj - bbk - bfd - bmo - bmv - byv - jgo - lmp - mgo - mnf - ngn - nla - nnh - oku - yam - ybb - mdm - mbu - gjn - buy - gya - bss - bum - dua - eto - ewo - iyx - khy - kkj - koq - ksf - lin - mcp - ngc - nxd - ozm - tll - tvu - won - yat - lem - loq - ibb - efi - ann - bfo - bim - biv - bud - bwu - dag - dga - dgd - dgi - gng - gur - gux - hag - kma - kus - maw - mfq - mos - soy - xon - mwm - myb - bjv - gqr - gvl - ksp - lap - sba - ndz - lnl - bun - gso - mur - did - tex - vut - tcc - kno - vai - tul - bst - ffm - fue - fuf - zne - guw - amh - bsp - bzw - nhu - avu - kbo - lgg - log - luc - xnz - uth - kyf - ijn - okr - shj - lro - mkl - yor - bin - ish - etu - fon - ful - gbr - atg - krw - wec - har - igl - ktj - ted - asg - kdl - tsw - xrb - kqs - gbo - lom - anv - ken - mfi - mev - ngb - fia - nwb - mdy - ebr - sef - iri - izr - kcg - spp - myk - dyi - sev - tgw - tem - tiv - sgw - dnj - wol - fak - sor - bwr - kqp - daa - mmy - hbb - aba - adj - ati - avn - nyb - tcd - bba - bky - bom - etx - gud - igb - ada - gaa - ewe - gol - yre - ibo - ikk - ikw - iqw - izz - klu - gkp - xpe - bov - ajg - krs - xed - niy - afr - knf - moy - iso - oke - urh - sus - yal - bsc - cou - wib - moa - ttr - kub - hau - bcw - kvj - giz - gnd - maf - meq - mfh - mfk - mif - mlr - mqb - muy - hna - bcy - gde - moz - bib - bqc - bus - ndv - snf - byf - lia - mlg - tir - rif - sbd - nhr - lmd - shi - gid - xan - hgm - sid - kab - xtc - kby - kri - wes - pcm - naq - thv - gax - gaz - orm - rel - aar - som - taq - ttq - dsh - mcn - mpg - bds - ses - cop - ber - crs - mfe - ktu - sag - kea - pov - ara - eng - fra - deu - hel - ita - por - rus - spa - tur tags: - Masked Langauge Model widget: - text: ẹ jọwọ , ẹ mi. - text: gbọ́ láìfọ̀rọ̀ gùn rárá. --- # Serengeti



Multilingual pretrained language models (mPLMs) acquire valuable, generalizable linguistic information during pretraining and have advanced the state of the art on task-specific finetuning.

To date, only ~31 out of 2,000 African languages are covered in existing language models. We ameliorate this limitation by developing SERENGETI, a set of massively multilingual language model that covers 517 African languages and language varieties. We evaluate our novel models on eight natural language understanding tasks across 20 datasets, comparing to 4 mPLMs that cover 4-23 African languages.

SERENGETI outperforms other models on 11 datasets across eights tasks, achieving 82.27 average F1-score. We also perform analyses of errors from our models, which allows us to investigate the influence of language genealogy and linguistic similarity when the models are applied under zero-shot settings. We will publicly release our models for research.
# 3. How to use Serengeti model Below is an example for using **Serengeti** predict masked tokens. ``` bash from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("UBC-NLP/serengeti", use_auth_token="XXX") model = AutoModelForMaskedLM.from_pretrained("UBC-NLP/serengeti", use_auth_token="XXX") from transformers import pipeline classifier = pipeline("fill-mask", model=model, tokenizer=tokenizer) classifier("ẹ jọwọ , ẹ mi") #Yoruba [{'score': 0.07887924462556839, 'token': 8418, 'token_str': 'ọmọ', 'sequence': 'ẹ jọwọ, ẹ ọmọ mi'}, {'score': 0.04658124968409538, 'token': 156595, 'token_str': 'fẹ́ràn', 'sequence': 'ẹ jọwọ, ẹ fẹ́ràn mi'}, {'score': 0.029315846040844917, 'token': 204050, 'token_str': 'gbàgbé', 'sequence': 'ẹ jọwọ, ẹ gbàgbé mi'}, {'score': 0.02790883742272854, 'token': 10730, 'token_str': 'kọ', 'sequence': 'ẹ jọwọ, ẹ kọ mi'}, {'score': 0.022904086858034134, 'token': 115382, 'token_str': 'bẹ̀rù', 'sequence': 'ẹ jọwọ, ẹ bẹ̀rù mi'}] ``` For the more details please read this notebook [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://github.com/UBC-NLP/serengeti/blob/main/Serengeti_notebook.ipynb) ## 4. Ethics Serengeti aligns with Afrocentric NLP where the needs of African people is put into consideration when developing technology. We believe Serengeti will not only be useful to speakers of the languages supported, but also researchers of African languages such as anthropologists and linguists. We discuss below some use cases for Serengeti and offer a number of broad impacts. - Serengeti aims to address the lack of access to technology in about 90\% of the world's languages, which automatically discriminates against native speakers of those languages. More precisely, it does so by focusing on Africa. To the best of our knowledge, Serengeti is the first massively multilingual PLM developed for African languages and language varieties. A model with knowledge of 517 African languages, is by far the largest to date for African NLP. - Serengeti enables improved access of important information to the African community in Indigenous African languages. This is especially beneficial for people who may not be fluent in other languages. This will potentially connect more people globally. - Serengeti affords opportunities for language preservation for many African languages. To the best of our knowledge, Serengeti consists of languages that have not been used for any NLP task until now. We believe that it can help encourage continued use of these languages in several domains, as well as trigger future development of language technologies for many of these languages. - To mitigate discrimination and bias, we adopt a manual curation of our datasets. Native speakers of Afrikaans, Yorùbá, Igbo, Hausa, Luganda, Kinyarwanda, Chichewa, Shona, Somali, Swahili, Xhosa, Bemba, and Zulu also manually evaluated a subset of the data to ensure its quality. The data collected for this work is taken from various domains to further ensure a better representation of the language usage of native speakers. - Although LMs are useful for a wide range of applications, they can also be misused. Serengeti is developed using publicly available datasets that may carry biases. Although we strive to perform analyses and diagnostic case studies to probe performance of our models, our investigations are by no means comprehensive nor guarantee absence of bias in the data. In particular, we do not have access to native speakers of most of the languages covered. This hinders our ability to investigate samples from each (or at least the majority) of the languages. ## Supported languages Please refer to [**suported-languages**](./supported-languages.txt) ## Citation If you use the pre-trained model (Serengeti) for your scientific publication, or if you find the resources in this repository useful, please cite our paper as follows (to be updated): ``` @inproceedings{adebara-etal-2023-serengeti, title = "{SERENGETI}: Massively Multilingual Language Models for {A}frica", author = "Adebara, Ife and Elmadany, AbdelRahim and Abdul-Mageed, Muhammad and Alcoba Inciarte, Alcides", booktitle = "Findings of the Association for Computational Linguistics: ACL 2023", month = jul, year = "2023", address = "Toronto, Canada", publisher = "Association for Computational Linguistics", url = "https://aclanthology.org/2023.findings-acl.97", doi = "10.18653/v1/2023.findings-acl.97", pages = "1498--1537", } ``` ## Acknowledgments We gratefully acknowledges support from Canada Research Chairs (CRC), the Natural Sciences and Engineering Research Council of Canada (NSERC; RGPIN-2018-04267), the Social Sciences and Humanities Research Council of Canada (SSHRC; 435-2018-0576; 895-2020-1004; 895-2021-1008), Canadian Foundation for Innovation (CFI; 37771), [Digital Research Alliance of Canada](https://alliancecan.ca), [UBC ARC-Sockeye](https://arc.ubc.ca/ubc-arc-sockeye), Advanced Micro Devices, Inc. (AMD), and Google. Any opinions, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of CRC, NSERC, SSHRC, CFI, the Alliance, AMD, Google, or UBC ARC-Sockeye.