masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0

Model

masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0

11

18 commits

1 linked in READMEs

updated Jun 25, 2023

See the code

README

masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0

Model description

masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0 is a Named Entity Recognition (NER) model for 21 African languages. Specifically, this model is a Davlan/afro-xlmr-large model that was fine-tuned on an aggregation of African language datasets obtained from two versions of MasakhaNER dataset i.e. MasakhaNER 1.0 and MasakhaNER 2.0. The languages covered are:

  • Amharic (Amharic)
  • Bambara (bam)
  • Ghomala (bbj)
  • Ewe (ewe)
  • Fon (fon)
  • Hausa (hau)
  • Igbo (ibo)
  • Kinyarwanda (kin)
  • Luganda (lug)
  • Dholuo (luo) -Mossi (mos)
  • Chichewa (nya)
  • Nigerian Pidgin
  • chShona (sna)
  • Kiswahili (swą)
  • Setswana (tsn)
  • Twi (twi)
  • Wolof (wol)
  • isiXhosa (xho)
  • Yorùbá (yor)
  • isiZulu (zul)

It has been trained to recognize four types of entities: dates & times (DATE), location (LOC), organization (ORG), and person (PER).

Intended uses & limitations

How to use

You can use this model with Transformers pipeline for NER.

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0")
model = AutoModelForTokenClassification.from_pretrained("masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0")
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "Emir of Kano turban Zhang wey don spend 18 years for Nigeria"
ner_results = nlp(example)
print(ner_results)

Eval results on MasakhaNER (F-score)

Model evaluated on MasakhaNER 1.0 and MasakhaNER 2.0 test sets

languageMasakhaNER 1.0MasakhaNER 2.0
amh80.5
bam83.1
bbj76.6
ewe89.6
fon83.8
hau90.387.5
ibo89.593.5
kin82.087.6
lug87.189.7
luo80.882.5
mos75.5
nya92.7
pcm91.190.9
sna96.5
swa88.593.4
tsn90.3
twi81.3
wol72.787.3
xho90.0
yor88.190.5
zul91.3
avg85.187.7

Limitations and bias

This model is limited by its training dataset of entity-annotated news articles from a specific span of time. This may not generalize well for all use cases in different domains.

Training data

This model was fine-tuned on the aggregation of MasakhaNER 1.0 and MasakhaNER 2.0 datasets

The training dataset distinguishes between the beginning and continuation of an entity so that if there are back-to-back entities of the same type, the model can output where the second entity begins. As in the dataset, each token will be classified as one of the following classes:

AbbreviationDescription
OOutside of a named entity
B-DATEBeginning of a DATE entity right after another DATE entity
I-DATEDATE entity
B-PERBeginning of a person’s name right after another person’s name
I-PERPerson’s name
B-ORGBeginning of an organisation right after another organisation
I-ORGOrganisation
B-LOCBeginning of a location right after another location
I-LOCLocation

Training procedure

This model was trained on a single NVIDIA V100 GPU with recommended hyperparameters from the original MasakhaNER paper which trained & evaluated the model on MasakhaNER corpus.

BibTeX entry and citation info

@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}
}
endpoints_compatible
multilingual
pytorch
safetensors
token-classification
transformers
xlm-roberta

Contributors

Davlan

17 commits

SFconvertbot

1 commits

masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0

Model

masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0

11

18 commits

1 linked in READMEs

updated Jun 25, 2023

See the code

README

masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0

Model description

masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0 is a Named Entity Recognition (NER) model for 21 African languages. Specifically, this model is a Davlan/afro-xlmr-large model that was fine-tuned on an aggregation of African language datasets obtained from two versions of MasakhaNER dataset i.e. MasakhaNER 1.0 and MasakhaNER 2.0. The languages covered are:

  • Amharic (Amharic)
  • Bambara (bam)
  • Ghomala (bbj)
  • Ewe (ewe)
  • Fon (fon)
  • Hausa (hau)
  • Igbo (ibo)
  • Kinyarwanda (kin)
  • Luganda (lug)
  • Dholuo (luo) -Mossi (mos)
  • Chichewa (nya)
  • Nigerian Pidgin
  • chShona (sna)
  • Kiswahili (swą)
  • Setswana (tsn)
  • Twi (twi)
  • Wolof (wol)
  • isiXhosa (xho)
  • Yorùbá (yor)
  • isiZulu (zul)

It has been trained to recognize four types of entities: dates & times (DATE), location (LOC), organization (ORG), and person (PER).

Intended uses & limitations

How to use

You can use this model with Transformers pipeline for NER.

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0")
model = AutoModelForTokenClassification.from_pretrained("masakhane/afroxlmr-large-ner-masakhaner-1.0_2.0")
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "Emir of Kano turban Zhang wey don spend 18 years for Nigeria"
ner_results = nlp(example)
print(ner_results)

Eval results on MasakhaNER (F-score)

Model evaluated on MasakhaNER 1.0 and MasakhaNER 2.0 test sets

languageMasakhaNER 1.0MasakhaNER 2.0
amh80.5
bam83.1
bbj76.6
ewe89.6
fon83.8
hau90.387.5
ibo89.593.5
kin82.087.6
lug87.189.7
luo80.882.5
mos75.5
nya92.7
pcm91.190.9
sna96.5
swa88.593.4
tsn90.3
twi81.3
wol72.787.3
xho90.0
yor88.190.5
zul91.3
avg85.187.7

Limitations and bias

This model is limited by its training dataset of entity-annotated news articles from a specific span of time. This may not generalize well for all use cases in different domains.

Training data

This model was fine-tuned on the aggregation of MasakhaNER 1.0 and MasakhaNER 2.0 datasets

The training dataset distinguishes between the beginning and continuation of an entity so that if there are back-to-back entities of the same type, the model can output where the second entity begins. As in the dataset, each token will be classified as one of the following classes:

AbbreviationDescription
OOutside of a named entity
B-DATEBeginning of a DATE entity right after another DATE entity
I-DATEDATE entity
B-PERBeginning of a person’s name right after another person’s name
I-PERPerson’s name
B-ORGBeginning of an organisation right after another organisation
I-ORGOrganisation
B-LOCBeginning of a location right after another location
I-LOCLocation

Training procedure

This model was trained on a single NVIDIA V100 GPU with recommended hyperparameters from the original MasakhaNER paper which trained & evaluated the model on MasakhaNER corpus.

BibTeX entry and citation info

@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}
}
endpoints_compatible
multilingual
pytorch
safetensors
token-classification
transformers
xlm-roberta

Contributors

Davlan

17 commits

SFconvertbot

1 commits