Commit
•
d0783a6
1
Parent(s):
7660346
Update README.md
Browse files
README.md
CHANGED
@@ -14,4 +14,61 @@ widget:
|
|
14 |
- text: "Ambasaderi Bellomo yavuze ko bishimira ubufatanye burambye hagati ya EU n’u Rwanda, bushingiye nanone ku bufatanye hagati y’imigabane ya Afurika n’u Burayi."
|
15 |
---
|
16 |
|
17 |
-
Model description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
- text: "Ambasaderi Bellomo yavuze ko bishimira ubufatanye burambye hagati ya EU n’u Rwanda, bushingiye nanone ku bufatanye hagati y’imigabane ya Afurika n’u Burayi."
|
15 |
---
|
16 |
|
17 |
+
# Model description
|
18 |
+
**mbert-base-uncased-kin** is a model based on the fine-tuned multilingual BERT base uncased model. It has been trained to recognize four types of entities:
|
19 |
+
- dates & time (DATE)
|
20 |
+
- Location (LOC)
|
21 |
+
- Organizations (ORG)
|
22 |
+
- Person (PER)
|
23 |
+
|
24 |
+
# Intended Use
|
25 |
+
- Intended to be used for research purposes concerning Named Entity Recognition for African Languages.
|
26 |
+
- Not intended for practical purposes.
|
27 |
+
|
28 |
+
# Training Data
|
29 |
+
This model was fine-tuned on the Kinyarwanda corpus **(kin)** 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.
|
30 |
+
|
31 |
+
# Training procedure
|
32 |
+
This model was trained on a single NVIDIA P5000 from [Paperspace](https://www.paperspace.com)
|
33 |
+
|
34 |
+
#### Hyperparameters
|
35 |
+
- **Learning Rate:** 5e-5
|
36 |
+
- **Batch Size:** 32
|
37 |
+
- **Maximum Sequence Length:** 164
|
38 |
+
- **Epochs:** 30
|
39 |
+
|
40 |
+
# Evaluation Data
|
41 |
+
We evaluated this model on the test split of the Kinyarwandan corpus **(kin)** present in the [MasakhaNER](https://github.com/masakhane-io/masakhane-ner) with no thresholding.
|
42 |
+
|
43 |
+
# Metrics
|
44 |
+
- Precision
|
45 |
+
- Recall
|
46 |
+
- F1-score
|
47 |
+
|
48 |
+
# Limitations
|
49 |
+
- The size of the pre-trained language model prevents its usage in anything other than research.
|
50 |
+
- Lack of analysis concerning the bias and fairness in these models may make them dangerous if deployed into production system.
|
51 |
+
- 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.
|
52 |
+
|
53 |
+
# Caveats and Recommendations
|
54 |
+
- The topics in the dataset corpus are centered around **News**. Future training could be done with a more diverse corpus.
|
55 |
+
|
56 |
+
# Results
|
57 |
+
Model Name| Precision | Recall | F1-score
|
58 |
+
-|-|-|-
|
59 |
+
**mbert-base-uncased-kin**| 81.35 | 83.98 | 82.64
|
60 |
+
|
61 |
+
# Usage
|
62 |
+
```python
|
63 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
64 |
+
from transformers import pipeline
|
65 |
+
|
66 |
+
tokenizer = AutoTokenizer.from_pretrained("arnolfokam/mbert-base-uncased-kin")
|
67 |
+
model = AutoModelForTokenClassification.from_pretrained("arnolfokam/mbert-base-uncased-kin")
|
68 |
+
|
69 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
70 |
+
example = "Rayon Sports yasinyishije rutahizamu w’Umurundi"
|
71 |
+
|
72 |
+
ner_results = nlp(example)
|
73 |
+
print(ner_results)
|
74 |
+
```
|