Downloads · 30 days
14
2% of all-time downloads
arnolfokam/bert-base-uncased-swa
bert-base-uncased-swa is a token classification model from arnolfokam. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as apache-2.0.
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: - dates & time (DATE) - Location (LOC) - Organizations (ORG) - Person (PER)
Downloads · 30 days
14
2% of all-time downloads
All-time downloads
641
Public
Repo size
862 MB
Likes
0
Public
Click a slice to open those files.
.bin431 MB · 100%
From the Hugging Face model README
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:
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.
This model was trained on a single NVIDIA P5000 from Paperspace
We evaluated this model on the test split of the Swahili corpus (swa) present in the MasakhaNER with no thresholding.
| Model Name | Precision | Recall | F1-score |
|---|---|---|---|
| bert-base-uncased-swa | 83.38 | 89.32 | 86.26 |
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)