add xlm-roberta-swahili
Browse files- README.md +61 -0
- config.json +27 -0
- pytorch_model.bin +3 -0
- sentencepiece.bpe.model +3 -0
- special_tokens_map.json +1 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
README.md
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Hugging Face's logo
|
2 |
+
---
|
3 |
+
language: ha
|
4 |
+
datasets:
|
5 |
+
|
6 |
+
---
|
7 |
+
# xlm-roberta-base-finetuned-swahili
|
8 |
+
## Model description
|
9 |
+
**xlm-roberta-base-finetuned-swahili** is a **Swahili RoBERTa** model obtained by fine-tuning **xlm-roberta-base** model on Swahili language texts. It provides **better performance** than the XLM-RoBERTa on text classification and named entity recognition datasets.
|
10 |
+
|
11 |
+
Specifically, this model is a *xlm-roberta-base* model that was fine-tuned on Swahili corpus.
|
12 |
+
## Intended uses & limitations
|
13 |
+
#### How to use
|
14 |
+
You can use this model with Transformers *pipeline* for masked token prediction.
|
15 |
+
```python
|
16 |
+
>>> from transformers import pipeline
|
17 |
+
>>> unmasker = pipeline('fill-mask', model='Davlan/xlm-roberta-base-finetuned-swahili')
|
18 |
+
>>> unmasker("Jumatatu, Bwana Kagame alielezea shirika la France24 huko [MASK] kwamba "hakuna uhalifu ulitendwa")
|
19 |
+
|
20 |
+
[{'sequence': 'Jumatatu, Bwana Kagame alielezea shirika la France24 huko Paris kwamba hakuna uhalifu ulitendwa',
|
21 |
+
'score': 0.31642526388168335,
|
22 |
+
'token': 10728,
|
23 |
+
'token_str': 'Paris'},
|
24 |
+
{'sequence': 'Jumatatu, Bwana Kagame alielezea shirika la France24 huko Rwanda kwamba hakuna uhalifu ulitendwa',
|
25 |
+
'score': 0.15753623843193054,
|
26 |
+
'token': 57557,
|
27 |
+
'token_str': 'Rwanda'},
|
28 |
+
{'sequence': 'Jumatatu, Bwana Kagame alielezea shirika la France24 huko Burundi kwamba hakuna uhalifu ulitendwa',
|
29 |
+
'score': 0.07211585342884064,
|
30 |
+
'token': 57824,
|
31 |
+
'token_str': 'Burundi'},
|
32 |
+
{'sequence': 'Jumatatu, Bwana Kagame alielezea shirika la France24 huko France kwamba hakuna uhalifu ulitendwa',
|
33 |
+
'score': 0.029844321310520172,
|
34 |
+
'token': 10688,
|
35 |
+
'token_str': 'France'},
|
36 |
+
{'sequence': 'Jumatatu, Bwana Kagame alielezea shirika la France24 huko Senegal kwamba hakuna uhalifu ulitendwa',
|
37 |
+
'score': 0.0265930388122797,
|
38 |
+
'token': 38052,
|
39 |
+
'token_str': 'Senegal'}]
|
40 |
+
|
41 |
+
```
|
42 |
+
#### Limitations and bias
|
43 |
+
This model is limited by its training dataset of entity-annotated news articles from a specific span of time. This may not generalize well for all use cases in different domains.
|
44 |
+
## Training data
|
45 |
+
This model was fine-tuned on [Swahili CC-100](http://data.statmt.org/cc-100/)
|
46 |
+
|
47 |
+
## Training procedure
|
48 |
+
This model was trained on a single NVIDIA V100 GPU
|
49 |
+
|
50 |
+
## Eval results on Test set (F-score, average over 5 runs)
|
51 |
+
Dataset| XLM-R F1 | sw_roberta F1
|
52 |
+
-|-|-
|
53 |
+
[MasakhaNER](https://github.com/masakhane-io/masakhane-ner) | 87.37 | 89.74
|
54 |
+
|
55 |
+
### BibTeX entry and citation info
|
56 |
+
By David Adelani
|
57 |
+
```
|
58 |
+
|
59 |
+
```
|
60 |
+
|
61 |
+
|
config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "xlm-roberta-base",
|
3 |
+
"architectures": [
|
4 |
+
"XLMRobertaForMaskedLM"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"gradient_checkpointing": false,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_dropout_prob": 0.1,
|
12 |
+
"hidden_size": 768,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 514,
|
17 |
+
"model_type": "xlm-roberta",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 12,
|
20 |
+
"output_past": true,
|
21 |
+
"pad_token_id": 1,
|
22 |
+
"position_embedding_type": "absolute",
|
23 |
+
"transformers_version": "4.4.2",
|
24 |
+
"type_vocab_size": 1,
|
25 |
+
"use_cache": true,
|
26 |
+
"vocab_size": 250002
|
27 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3b33338b12827b5779ff92584f7a6f6dfed1f0ed547242a0e7d4931c87ec8e77
|
3 |
+
size 1113271890
|
sentencepiece.bpe.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
|
3 |
+
size 5069051
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "sep_token": "</s>", "cls_token": "<s>", "unk_token": "<unk>", "pad_token": "<pad>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "xlm-roberta-base"}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4f3549bf468875a3dbc7c2e58b9976bb9804f65e4f56fdc1d5321bba4e75c716
|
3 |
+
size 2287
|