NER

Model description

mbert-base-uncased-ner-swa is a model based on the fine-tuned Multilingual BERT base uncased model, previously fine-tuned for Named Entity Recognition using 10 high-resourced languages. It has been trained to recognize four types of entities:

Intended Use

Training Data

This model was fine-tuned on the Swahili corpus (swa) of the MasakhaNER dataset. However, we thresholded the number of entity groups per sentence in this dataset to 10 entity groups.

Training procedure

This model was trained on a single NVIDIA P5000 from Paperspace

Hyperparameters

Evaluation Data

We evaluated this model on the test split of the Swahili corpus (swa) present in the MasakhaNER with no thresholding.

Metrics

Limitations

Caveats and Recommendations

Results

Model Name Precision Recall F1-score
mbert-base-uncased-ner-swa 82.85 88.13 85.41

Usage

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("arnolfokam/mbert-base-uncased-ner-swa")
model = AutoModelForTokenClassification.from_pretrained("arnolfokam/mbert-base-uncased-ner-swa")

nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "Wizara ya afya ya Tanzania imeripoti Jumatatu kuwa, watu takriban 14 zaidi wamepata maambukizi ya Covid-19."

ner_results = nlp(example)
print(ner_results)