arnolfokam
commited on
Commit
•
f8e7921
1
Parent(s):
29ef1a1
Update README.md
Browse files
README.md
CHANGED
@@ -13,4 +13,64 @@ license: apache-2.0
|
|
13 |
widget:
|
14 |
- text: "Wizara ya afya ya Tanzania imeripoti Jumatatu kuwa, watu takriban 14 zaidi wamepata maambukizi ya Covid-19."
|
15 |
---
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
widget:
|
14 |
- text: "Wizara ya afya ya Tanzania imeripoti Jumatatu kuwa, watu takriban 14 zaidi wamepata maambukizi ya Covid-19."
|
15 |
---
|
16 |
+
|
17 |
+
# Model description
|
18 |
+
**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:
|
19 |
+
|
20 |
+
- dates & time (DATE)
|
21 |
+
- Location (LOC)
|
22 |
+
- Organizations (ORG)
|
23 |
+
- Person (PER)
|
24 |
+
|
25 |
+
# Intended Use
|
26 |
+
- Intended to be used for research purposes concerning Named Entity Recognition for African Languages.
|
27 |
+
- Not intended for practical purposes.
|
28 |
+
|
29 |
+
# Training Data
|
30 |
+
This model was fine-tuned on the Swahili corpus **(swa)** of the [MasakhaNER](https://github.com/masakhane-io/masakhane-ner) dataset. However, we thresholded the number of entity groups per sentence in this dataset to 10 entity groups.
|
31 |
+
|
32 |
+
# Training procedure
|
33 |
+
This model was trained on a single NVIDIA P5000 from [Paperspace](https://www.paperspace.com)
|
34 |
+
#### Hyperparameters
|
35 |
+
- **Learning Rate:** 5e-5
|
36 |
+
- **Batch Size:** 32
|
37 |
+
- **Maximum Sequence Length:** 164
|
38 |
+
- **Epochs:** 30
|
39 |
+
|
40 |
+
|
41 |
+
# Evaluation Data
|
42 |
+
We evaluated this model on the test split of the Swahili corpus **(swa)** present in the [MasakhaNER](https://github.com/masakhane-io/masakhane-ner) with no thresholding.
|
43 |
+
|
44 |
+
# Metrics
|
45 |
+
- Precision
|
46 |
+
- Recall
|
47 |
+
- F1-score
|
48 |
+
|
49 |
+
# Limitations
|
50 |
+
- The size of the pre-trained language model prevents its usage in anything other than research.
|
51 |
+
- Lack of analysis concerning the bias and fairness in these models may make them dangerous if deployed into production system.
|
52 |
+
- The train data is a less populated version of the original dataset in terms of entity groups per sentence. Therefore, this can negatively impact the performance.
|
53 |
+
|
54 |
+
# Caveats and Recommendations
|
55 |
+
- The topics in the dataset corpus are centered around **News**. Future training could be done with a more diverse corpus.
|
56 |
+
|
57 |
+
# Results
|
58 |
+
Model Name| Precision | Recall | F1-score
|
59 |
+
-|-|-|-
|
60 |
+
**mbert-base-uncased-ner-swa**| 82.85 | 88.13 | 85.41
|
61 |
+
|
62 |
+
# Usage
|
63 |
+
|
64 |
+
```python
|
65 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
66 |
+
from transformers import pipeline
|
67 |
+
|
68 |
+
tokenizer = AutoTokenizer.from_pretrained("arnolfokam/mbert-base-uncased-ner-swa")
|
69 |
+
model = AutoModelForTokenClassification.from_pretrained("arnolfokam/mbert-base-uncased-ner-swa")
|
70 |
+
|
71 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
72 |
+
example = "Wizara ya afya ya Tanzania imeripoti Jumatatu kuwa, watu takriban 14 zaidi wamepata maambukizi ya Covid-19."
|
73 |
+
|
74 |
+
ner_results = nlp(example)
|
75 |
+
print(ner_results)
|
76 |
+
```
|