eolang / sw-fillmask

huggingface.co
Total runs: 20
24-hour runs: 0
7-day runs: -5
30-day runs: 0
Model's Last Updated: August 02 2026
fill-mask

Introduction of sw-fillmask

Model Details of sw-fillmask

SW-FillMask - Swahili Masked Language Model

Model description

SW-FillMask is a BERT-based transformer model pre-trained on a large corpus of Swahili text in a self-supervised fashion. The model was trained specifically to handle real-world Kenyan Swahili, which frequently involves code-mixing with English - a limitation of most existing Swahili NLP models trained on formal, clean text.

It was pre-trained on raw texts only, with no human labeling, using an automatic process to generate inputs and labels. More precisely, it was pre-trained with one objective:

  • Masked language modeling (MLM): taking a sentence, the model randomly masks 15% of the words in the input then runs the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the terms one after the other, or from autoregressive models like GPT which internally masks the future tokens. It allows the model to learn a bidirectional representation of the sentence.

This way, the model learns an inner representation of the Swahili language that can then be used to extract features useful for downstream tasks e.g.

  • Named Entity Recognition (Token Classification)
  • Text Classification
  • Sentiment Analysis

The model is based on the original BERT UNCASED which can be found on google-research/bert readme

Training data

The model was pre-trained on a curated corpus of Swahili text scraped from publicly available sources, with particular attention to Kenyan Swahili usage patterns including natural code-switching between Swahili and English. Standard preprocessing was applied including tokenisation and text cleaning.

Intended uses & limitations

You can use the raw model for masked language modeling, but it is primarily intended to be fine-tuned on a downstream task.

Best suited for:

  • Swahili NLP research and applications
  • Low-resource language modelling
  • Downstream fine-tuning for NER, text classification, sentiment analysis

Not recommended for:

  • Direct use in production without fine-tuning
  • Tasks requiring formal or standardised Swahili only
How to use

You can use this model directly with a pipeline for masked language modeling:

Fill Mask Pipeline
from transformers import pipeline

fill_mask = pipeline("fill-mask", model="eolang/sw-fillmask")

sample_text = "Tumefanya mabadiliko muhimu [MASK] sera zetu za faragha na vidakuzi"

for prediction in fill_mask(sample_text):
    print(f"{prediction['sequence']}, confidence: {prediction['score']:.4f}")
Tokenizer
from transformers import AutoTokenizer, AutoModelForMaskedLM

tokenizer = AutoTokenizer.from_pretrained("eolang/sw-fillmask")
model = AutoModelForMaskedLM.from_pretrained("eolang/sw-fillmask")

text = "Hii ni tovuti ya idhaa ya Kiswahili ya BBC ambayo hukuletea habari na makala kutoka Afrika na kote duniani kwa lugha ya Kiswahili."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
print(output)
Fine-tuning for Token Classification (NER)
from transformers import AutoTokenizer, AutoModelForTokenClassification

tokenizer = AutoTokenizer.from_pretrained("eolang/sw-fillmask")
model = AutoModelForTokenClassification.from_pretrained("eolang/sw-fillmask", num_labels=NUM_LABELS)
Limitations and Bias

Even if the training data used for this model could be reasonably neutral, this model can have biased predictions. The model's performance on formal or standardised Swahili may also differ from its performance on informal or code-mixed text. This is something I'm still working on improving. Feel free to share suggestions/comments via Discussions

Citation

If you use this model in your research, please cite:

@misc{olang2026swfillmask,
  author = {Olang', Emmanuel},
  title = {SW-FillMask: A Swahili Masked Language Model},
  year = {2026},
  publisher = {HuggingFace},
  url = {https://huggingface.co/eolang/sw-fillmask}
}

Model developed by Emmanuel Olang' | GitHub | Website

Runs of eolang sw-fillmask on huggingface.co

20
Total runs
0
24-hour runs
0
3-day runs
-5
7-day runs
0
30-day runs

More Information About sw-fillmask huggingface.co Model

More sw-fillmask license Visit here:

https://choosealicense.com/licenses/mit

sw-fillmask huggingface.co

sw-fillmask huggingface.co is an AI model on huggingface.co that provides sw-fillmask's model effect (), which can be used instantly with this eolang sw-fillmask model. huggingface.co supports a free trial of the sw-fillmask model, and also provides paid use of the sw-fillmask. Support call sw-fillmask model through api, including Node.js, Python, http.

sw-fillmask huggingface.co Url

https://huggingface.co/eolang/sw-fillmask

eolang sw-fillmask online free

sw-fillmask huggingface.co is an online trial and call api platform, which integrates sw-fillmask's modeling effects, including api services, and provides a free online trial of sw-fillmask, you can try sw-fillmask online for free by clicking the link below.

eolang sw-fillmask online free url in huggingface.co:

https://huggingface.co/eolang/sw-fillmask

sw-fillmask install

sw-fillmask is an open source model from GitHub that offers a free installation service, and any user can find sw-fillmask on GitHub to install. At the same time, huggingface.co provides the effect of sw-fillmask install, users can directly use sw-fillmask installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

sw-fillmask install url in huggingface.co:

https://huggingface.co/eolang/sw-fillmask

Url of sw-fillmask

sw-fillmask huggingface.co Url

Provider of sw-fillmask huggingface.co

eolang
ORGANIZATIONS

Other API from eolang

huggingface.co

Total runs: 27
Run Growth: -49
Growth Rate: -181.48%
Updated:January 16 2023
huggingface.co

Total runs: 13
Run Growth: 0
Growth Rate: 0.00%
Updated:March 16 2025
huggingface.co

Total runs: 12
Run Growth: 0
Growth Rate: 0.00%
Updated:July 27 2025
huggingface.co

Total runs: 11
Run Growth: 0
Growth Rate: 0.00%
Updated:April 04 2025
huggingface.co

Total runs: 11
Run Growth: 0
Growth Rate: 0.00%
Updated:April 08 2025
huggingface.co

Total runs: 9
Run Growth: 4
Growth Rate: 44.44%
Updated:June 20 2023
huggingface.co

Total runs: 8
Run Growth: 8
Growth Rate: 100.00%
Updated:September 09 2025
huggingface.co

Total runs: 7
Run Growth: 0
Growth Rate: 0.00%
Updated:May 14 2025
huggingface.co

Total runs: 6
Run Growth: -4
Growth Rate: -66.67%
Updated:September 15 2023
huggingface.co

Total runs: 5
Run Growth: 0
Growth Rate: 0.00%
Updated:March 30 2025
huggingface.co

Total runs: 3
Run Growth: 1
Growth Rate: 33.33%
Updated:August 22 2025
huggingface.co

Total runs: 3
Run Growth: 0
Growth Rate: 0.00%
Updated:July 06 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 17 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 29 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 24 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 30 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:July 24 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 25 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:December 01 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 15 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 01 2025