Commit ·
e5b454f
1
Parent(s): 1c4d75e
Update README.md
Browse files
README.md
CHANGED
|
@@ -13,4 +13,61 @@ license: apache-2.0
|
|
| 13 |
widget:
|
| 14 |
- text: "Mixed Martial Arts joinbodi, Ultimate Fighting Championship, UFC don decide say dem go enta back di octagon on Saturday, 9 May, for Jacksonville, Florida."
|
| 15 |
---
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
widget:
|
| 14 |
- text: "Mixed Martial Arts joinbodi, Ultimate Fighting Championship, UFC don decide say dem go enta back di octagon on Saturday, 9 May, for Jacksonville, Florida."
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# Model description
|
| 18 |
+
**roberta-base-pcm** is a model based on the fine-tuned 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 Nigerian Pidgin corpus **(pcm)** 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 |
+
#### Hyperparameters
|
| 34 |
+
- **Learning Rate:** 5e-5
|
| 35 |
+
- **Batch Size:** 32
|
| 36 |
+
- **Maximum Sequence Length:** 164
|
| 37 |
+
- **Epochs:** 30
|
| 38 |
+
|
| 39 |
+
# Evaluation Data
|
| 40 |
+
We evaluated this model on the test split of the Swahili corpus **(pcm)** present in the [MasakhaNER](https://github.com/masakhane-io/masakhane-ner) with no thresholding.
|
| 41 |
+
|
| 42 |
+
# Metrics
|
| 43 |
+
- Precision
|
| 44 |
+
- Recall
|
| 45 |
+
- F1-score
|
| 46 |
+
|
| 47 |
+
# Limitations
|
| 48 |
+
- The size of the pre-trained language model prevents its usage in anything other than research.
|
| 49 |
+
- Lack of analysis concerning the bias and fairness in these models may make them dangerous if deployed into production system.
|
| 50 |
+
- 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.
|
| 51 |
+
|
| 52 |
+
# Caveats and Recommendations
|
| 53 |
+
- The topics in the dataset corpus are centered around **News**. Future training could be done with a more diverse corpus.
|
| 54 |
+
|
| 55 |
+
# Results
|
| 56 |
+
Model Name| Precision | Recall | F1-score
|
| 57 |
+
-|-|-|-
|
| 58 |
+
**roberta-base-pcm**| 88.55 | 82.45 | 85.39
|
| 59 |
+
|
| 60 |
+
# Usage
|
| 61 |
+
```python
|
| 62 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 63 |
+
from transformers import pipeline
|
| 64 |
+
|
| 65 |
+
tokenizer = AutoTokenizer.from_pretrained("arnolfokam/roberta-base-pcm")
|
| 66 |
+
model = AutoModelForTokenClassification.from_pretrained("roberta-base-pcm")
|
| 67 |
+
|
| 68 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 69 |
+
example = "Mixed Martial Arts joinbodi, Ultimate Fighting Championship, UFC don decide say dem go enta back di octagon on Saturday, 9 May, for Jacksonville, Florida."
|
| 70 |
+
|
| 71 |
+
ner_results = nlp(example)
|
| 72 |
+
print(ner_results)
|
| 73 |
+
```
|