NER

Model description

bert-base-uncased-swa is a model based on the fine-tuned BERT base uncased model. 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
bert-base-uncased-swa 83.38 89.32 86.26

Usage

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("arnolfokam/bert-base-uncased-swa")
model = AutoModelForTokenClassification.from_pretrained("bert-base-uncased-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)