add yoruba adr model
Browse files- README.md +42 -0
- config.json +28 -0
- model_args.json +1 -0
- optimizer.pt +3 -0
- pytorch_model.bin +3 -0
- scheduler.pt +3 -0
- special_tokens_map.json +1 -0
- spiece.model +3 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
README.md
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Hugging Face's logo
|
2 |
+
---
|
3 |
+
language: yo
|
4 |
+
datasets:
|
5 |
+
- JW300 + [Menyo-20k](https://huggingface.co/datasets/menyo20k_mt)
|
6 |
+
---
|
7 |
+
# mT5_base_yoruba_adr
|
8 |
+
## Model description
|
9 |
+
**mT5_base_yoruba_adr** is a **automatic diacritics restoration** model for Yorùbá language based on a fine-tuned mT5-base model. It achieves the **state-of-the-art performance** for adding the correct diacritics or tonal marks to Yorùbá texts.
|
10 |
+
|
11 |
+
Specifically, this model is a *mT5_base* model that was fine-tuned on JW300 Yorùbá corpus and [Menyo-20k](https://huggingface.co/datasets/menyo20k_mt)
|
12 |
+
## Intended uses & limitations
|
13 |
+
#### How to use
|
14 |
+
You can use this model with Transformers *pipeline* for NER.
|
15 |
+
```python
|
16 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
17 |
+
from transformers import pipeline
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained("")
|
19 |
+
model = AutoModelForTokenClassification.from_pretrained("")
|
20 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
21 |
+
example = "Emir of Kano turban Zhang wey don spend 18 years for Nigeria"
|
22 |
+
ner_results = nlp(example)
|
23 |
+
print(ner_results)
|
24 |
+
```
|
25 |
+
#### Limitations and bias
|
26 |
+
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.
|
27 |
+
## Training data
|
28 |
+
This model was fine-tuned on on JW300 Yorùbá corpus and [Menyo-20k](https://huggingface.co/datasets/menyo20k_mt) dataset
|
29 |
+
|
30 |
+
## Training procedure
|
31 |
+
This model was trained on a single NVIDIA V100 GPU
|
32 |
+
|
33 |
+
## Eval results on Test set (BLEU score)
|
34 |
+
64.63 BLEU on [Global Voices test set](https://arxiv.org/abs/2003.10564)
|
35 |
+
70.27 BLEU on [Menyo-20k test set](https://arxiv.org/abs/2103.08647)
|
36 |
+
|
37 |
+
### BibTeX entry and citation info
|
38 |
+
```
|
39 |
+
|
40 |
+
```
|
41 |
+
|
42 |
+
|
config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "google/mt5-base",
|
3 |
+
"architectures": [
|
4 |
+
"MT5ForConditionalGeneration"
|
5 |
+
],
|
6 |
+
"d_ff": 2048,
|
7 |
+
"d_kv": 64,
|
8 |
+
"d_model": 768,
|
9 |
+
"decoder_start_token_id": 0,
|
10 |
+
"dropout_rate": 0.1,
|
11 |
+
"eos_token_id": 1,
|
12 |
+
"feed_forward_proj": "gated-gelu",
|
13 |
+
"initializer_factor": 1.0,
|
14 |
+
"is_encoder_decoder": true,
|
15 |
+
"layer_norm_epsilon": 1e-06,
|
16 |
+
"model_type": "mt5",
|
17 |
+
"num_decoder_layers": 12,
|
18 |
+
"num_heads": 12,
|
19 |
+
"num_layers": 12,
|
20 |
+
"output_past": true,
|
21 |
+
"pad_token_id": 0,
|
22 |
+
"relative_attention_num_buckets": 32,
|
23 |
+
"tie_word_embeddings": false,
|
24 |
+
"tokenizer_class": "T5Tokenizer",
|
25 |
+
"transformers_version": "4.4.1",
|
26 |
+
"use_cache": true,
|
27 |
+
"vocab_size": 250112
|
28 |
+
}
|
model_args.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"adam_epsilon": 1e-08, "best_model_dir": "outputs/best_model", "cache_dir": "cache_dir/", "config": {}, "cosine_schedule_num_cycles": 0.5, "custom_layer_parameters": [], "custom_parameter_groups": [], "dataloader_num_workers": 0, "do_lower_case": false, "dynamic_quantize": false, "early_stopping_consider_epochs": false, "early_stopping_delta": 0, "early_stopping_metric": "eval_loss", "early_stopping_metric_minimize": true, "early_stopping_patience": 3, "encoding": null, "adafactor_eps": [1e-30, 0.001], "adafactor_clip_threshold": 1.0, "adafactor_decay_rate": -0.8, "adafactor_beta1": null, "adafactor_scale_parameter": false, "adafactor_relative_step": false, "adafactor_warmup_init": false, "eval_batch_size": 20, "evaluate_during_training": true, "evaluate_during_training_silent": true, "evaluate_during_training_steps": 30000, "evaluate_during_training_verbose": false, "evaluate_each_epoch": true, "fp16": false, "gradient_accumulation_steps": 1, "learning_rate": 0.001, "local_rank": -1, "logging_steps": 50, "manual_seed": 42, "max_grad_norm": 1.0, "max_seq_length": 190, "model_name": "google/mt5-base", "model_type": "mt5", "multiprocessing_chunksize": -1, "n_gpu": 1, "no_cache": true, "no_save": false, "not_saved_args": [], "num_train_epochs": 5, "optimizer": "Adafactor", "output_dir": "outputs/", "overwrite_output_dir": true, "process_count": 254, "polynomial_decay_schedule_lr_end": 1e-07, "polynomial_decay_schedule_power": 1.0, "quantized_model": false, "reprocess_input_data": true, "save_best_model": true, "save_eval_checkpoints": false, "save_model_every_epoch": true, "save_optimizer_and_scheduler": true, "save_steps": -1, "scheduler": "constant_schedule_with_warmup", "silent": false, "skip_special_tokens": true, "tensorboard_dir": null, "thread_count": null, "tokenizer_type": null, "tokenizer_name": null, "train_batch_size": 20, "train_custom_parameters_only": false, "use_cached_eval_features": false, "use_early_stopping": true, "use_multiprocessing": false, "use_multiprocessing_for_evaluation": false, "wandb_kwargs": {}, "wandb_project": "MT5 Yoruba noDiac to Underdot Translation", "warmup_ratio": 0.06, "warmup_steps": 7239, "weight_decay": 0.0, "model_class": "T5Model", "dataset_class": null, "do_sample": false, "early_stopping": true, "evaluate_generated_text": false, "length_penalty": 2.0, "max_length": 20, "max_steps": -1, "num_beams": 1, "num_return_sequences": 1, "preprocess_inputs": false, "repetition_penalty": 1.0, "special_tokens_list": [], "top_k": null, "top_p": null, "use_multiprocessed_decoding": true}
|
optimizer.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0b3a4dc5f06b4932c14aa42c8960e3af652fbc7cbc4066207c886a25f0383614
|
3 |
+
size 4130943
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6035ffa0ae47175a1a6de254a17e098bc86ebbc9fdda4e607d2fc735df18e41f
|
3 |
+
size 2329707353
|
scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:54a781da6e71dd23c71b7d4fc3035e0f891569f5e8792b3bb6210c5e5cbf5731
|
3 |
+
size 623
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>"}
|
spiece.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ef78f86560d809067d12bac6c09f19a462cb3af3f54d2b8acbba26e1433125d6
|
3 |
+
size 4309802
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>", "extra_ids": 0, "additional_special_tokens": null, "special_tokens_map_file": "/home/patrick/.cache/torch/transformers/685ac0ca8568ec593a48b61b0a3c272beee9bc194a3c7241d15dcadb5f875e53.f76030f3ec1b96a8199b2593390c610e76ca8028ef3d24680000619ffb646276", "tokenizer_file": null, "name_or_path": "google/mt5-base", "truncate": true}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a62a1495fa15f5e3e09eed385a59c1a5260f40ef1f00f6818f672f932c746cee
|
3 |
+
size 3119
|