Views
No views yet
1import torch
2from transformers import BertTokenizer
3
4tokenizer = BertTokenizer.from_pretrained("swahbert-base-uncased")
5
6# Tokenized input
7text = "Mlima Kilimanjaro unapatikana Tanzania"
8tokenized_text = tokenizer.tokenize(text)
9
10SwahBERT => ['mlima', 'kilimanjaro', 'unapatikana', 'tanzania']
11mBERT => ['ml', '##ima', 'ki', '##lima', '##nja', '##ro', 'una', '##patikana', 'tan', '##zania']
12United Nations news, Voice of America (VoA), Deutsche Welle (DW) and taifaleoJaiiForumWikipedia.SwahBERT-Base, Uncased:12-layer, 768-hidden, 12-heads , 124M parametersSwahBERT-Base, Cased:12-layer, 768-hidden, 12-heads , 111M parameters| Steps | vocab size | MLM acc | NSP acc | loss |
|---|---|---|---|---|
| 800K | 50K (uncased) | 76.54 | 99.67 | 1.0667 |
| 800K | 32K (cased) | 76.94 | 99.33 | 1.0562 |
Swahili emotion dataset.| Tasks | SwahBERT | SwahBERT_cased | mBERT |
|---|---|---|---|
| Emotion | 64.46 | 64.77 | 60.52 |
| News | 90.90 | 89.90 | 89.73 |
| Sentiment | 70.94 | 71.12 | 67.20 |
| NER | 88.50 | 88.60 | 89.36 |
@inproceedings{martin-etal-2022-swahbert,
title = "{S}wah{BERT}: Language Model of {S}wahili",
author = "Martin, Gati and Mswahili, Medard Edmund and Jeong, Young-Seob and Woo, Jiyoung",
booktitle = "Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies",
month = jul,
year = "2022",
address = "Seattle, United States",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.naacl-main.23",
pages = "303--313"
}