arnolfokam commited on
Commit
c7fe483
1 Parent(s): 79ba66f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +61 -1
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
- Model description
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ **roberta-base-swa** is a model based on the fine-tuned RoBERTa base model. 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
+ **roberta-base-swa**| 80.58 | 86.79 | 83.57
61
+
62
+ # Usage
63
+
64
+ ```python
65
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
66
+ from transformers import pipeline
67
+
68
+ tokenizer = AutoTokenizer.from_pretrained("arnolfokam/roberta-base-swa")
69
+ model = AutoModelForTokenClassification.from_pretrained("arnolfokam/roberta-base-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
+ ```