Views
No views yet
1from transformers import AutoTokenizer, AutoModelForTokenClassification
2from transformers import pipeline
3tokenizer = AutoTokenizer.from_pretrained("masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0")
4model = AutoModelForTokenClassification.from_pretrained("masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0")
5nlp = pipeline("ner", model=model, tokenizer=tokenizer)
6example = "Emir of Kano turban Zhang wey don spend 18 years for Nigeria"
7ner_results = nlp(example)
8print(ner_results)| language | MasakhaNER 1.0 | MasakhaNER 2.0 |
|---|---|---|
| amh | 80.5 | |
| bam | 83.1 | |
| bbj | 76.6 | |
| ewe | 89.6 | |
| fon | 83.8 | |
| hau | 90.3 | 87.5 |
| ibo | 89.5 | 93.5 |
| kin | 82.0 | 87.6 |
| lug | 87.1 | 89.7 |
| luo | 80.8 | 82.5 |
| mos | 75.5 | |
| nya | 92.7 | |
| pcm | 91.1 | 90.9 |
| sna | 96.5 | |
| swa | 88.5 | 93.4 |
| tsn | 90.3 | |
| twi | 81.3 | |
| wol | 72.7 | 87.3 |
| xho | 90.0 | |
| yor | 88.1 | 90.5 |
| zul | 91.3 | |
| avg | 85.1 | 87.7 |
| Abbreviation | Description |
|---|---|
| O | Outside of a named entity |
| B-DATE | Beginning of a DATE entity right after another DATE entity |
| I-DATE | DATE entity |
| B-PER | Beginning of a person’s name right after another person’s name |
| I-PER | Person’s name |
| B-ORG | Beginning of an organisation right after another organisation |
| I-ORG | Organisation |
| B-LOC | Beginning of a location right after another location |
| I-LOC | Location |
@article{Adelani2022MasakhaNER2A,
title={MasakhaNER 2.0: Africa-centric Transfer Learning for Named Entity Recognition},
author={David Ifeoluwa Adelani and Graham Neubig and Sebastian Ruder and Shruti Rijhwani and Michael Beukman and Chester Palen-Michel and Constantine Lignos and Jesujoba Oluwadara Alabi and Shamsuddeen Hassan Muhammad and Peter Nabende and Cheikh M. Bamba Dione and Andiswa Bukula and Rooweither Mabuya and Bonaventure F. P. Dossou and Blessing K. Sibanda and Happy Buzaaba and Jonathan Mukiibi and Godson Kalipe and Derguene Mbaye and Amelia Taylor and Fatoumata Kabore and Chris C. Emezue and Anuoluwapo Aremu and Perez Ogayo and Catherine W. Gitau and Edwin Munkoh-Buabeng and Victoire Memdjokam Koagne and Allahsera Auguste Tapo and Tebogo Macucwa and Vukosi Marivate and Elvis Mboning and Tajuddeen R. Gwadabe and Tosin P. Adewumi and Orevaoghene Ahia and Joyce Nakatumba-Nabende and Neo L. Mokono and Ignatius M Ezeani and Chiamaka Ijeoma Chukwuneke and Mofetoluwa Adeyemi and Gilles Hacheme and Idris Abdulmumin and Odunayo Ogundepo and Oreen Yousuf and Tatiana Moteu Ngoli and Dietrich Klakow},
journal={ArXiv},
year={2022},
volume={abs/2210.12391}
}