Categories
data python tools

Swahili text normalizer

One of the challenges with working with text corpus, that will be used for voice datasets, is that you will encounter non-standard text like percentages, numbers, time and date. These can be a challenge when one has to read them. For example 23 could be read as twenty three or two three. To fix such an issue you do what is called text normalization during the cleaning and validation stage for your text corpus. This is helpful especially when your text corpus will be used for speech use cases.

Text normalization in speech applications converts written, non-standard text (like numbers, symbols, and abbreviations) into spoken-word forms for text-to-speech (TTS), or structures raw audio transcripts into clean data for automatic speech recognition (ASR)

During my fellowship with Mozilla Foundation working on the common voice text corpus for Kiswahili, this is something I encountered during the sentence validation stage. On the common voice platform, one way one can contribute to building the Swahili voice dataset is to read sentences in the Swahili language. The sentences went through a validation stage before they were ready for reading. You can see that encountering something like 3.5% might slow the reader (silence in the voice clip making it longer) or present a challenge of how to read the percentage. For English you can use already existing natural language processing tools to do text normalization.

I spent some time working on a small library for the Swahili language. Its a small collection of utilities that convert:

  • Numbers to words (0 .. < 1e9)
  • Years, dates, times to words
  • Decimals, percentages to words

You can find the source code here https://github.com/bmwasaru/kiswahili-text-normalizer and the readme file has instructions on how to install and use it. Here is an example usage:


>>> import kiswahili_text_normalizer as ktn
>>> text = "Tutakutane 20/11/2025 14:30, malipo ni 12.5%."
>>> print(ktn.normalize_text(text, profile="asr"))
tutakutane tarehe ishirini mwezi wa kumi na moja mwaka elfu mbili ishirini na tano 
saa nane na nusu malipo ni asilimia kumi na mbili nukta tano

As you can see it converts

  • 20/11/2025 to tarehe ishirini mwezi wa kumi na moja mwaka elfu mbili ishirini na tano
  • 14:30 to saa nane na nusu
  • 12.5% asilimia kumi na mbili nukta tano

You will note it adds keywords like tarehe to denote date, saa to denote time, nukta to denote decimal point and asilimia to denote percentage.

I have used this on text that I had scrapped from the Voice of America Swahili news website before it shutdown. The code for that can be found here https://github.com/bmwasaru/voa/blob/main/scripts/normalize_text.py. This was a perfect use case because this was a large text corpus and the normalizer was able to quickly find and convert. Side note, if you are looking for Swahili language text you can find the scraped text in cvs files here https://github.com/bmwasaru/voa/tree/main/sentences.

I hope one finds this useful and please share some feedback 🙂

Categories
tools

Kamusi.io

Introducing https://kamusi.io, offline mobile friendly dictionary for Swahili words. The kamusi consists of a random word of the day and a search feature to look up words. The search results include the definition of searched word and some might have example usage in a sentence and synonyms.

You can install this dictionary on your mobile device, laptop or desktop. This was designed as a progressive web app meaning it’s a website that can be accessible as a mobile application. Once installed you can access it even when offline.

To install visit the website http://kamusi.io on your mobile or laptop browser then “Add to Home Screen”. On Android (Chrome/Firefox) tap the three-dot menu and select Install app or Add to Home screen. On iPhone (Safari) tap the share button then scroll down to select “Add to Home screen”. On Mac (Safari) click on the share button and then the “Add to Dock” option will install it on your dock. On a laptop (Chrome) you will see “Install App” icon at the far right end of the URL bar.

screenshot of kamusi.io

I would like to mention that this an ad free resource with no tracking of usage which means I don’t get to know from where and how many people are using the kamusi. I do hope you share your feedback with me 🙂

I would like to thank Kaleb for the words. The words on the kamusi come from his GitHub repository here https://github.com/Kalebu/kamusi. This project is also open sourced and the code can be accessed here https://github.com/bmwasaru/kamusi-io

Categories
photography privacy tools

EXIF Remover Desktop App

UPDATE: This was replaced with a progressive web app (PWA) because that’s easier to use and main cross platforms. Source here https://github.com/bmwasaru/Scrub-Metadata

Spent some time building a desktop app to help me remove EXIF data from my photographs before posting them online. This matters to me because I don’t want to be profiled based on the location, time and even the device I use to take the photos on. Also the other thing that matters is I wouldn’t want to expose others through the location data that may be included in the photographs.

If you look at the info section of the photos on my previous post here https://britone.xyz/2025/10/06/at-the-workshop/ you might catch the data that was uploaded with the photos. Data such as the phone type and the app that I used to take the photo. Previously, I had worked on an AppleScript (https://britone.xyz/2024/11/11/remove-exif-data-on-macos/) to help with cleaning of data but that was not very intuitive.

For the technicalities about the development; its build using electronjs meaning its cross platform out of the box. All you need is to run the build.sh command to generate the assets (apps) for MacOS, Windows and Linux platforms. The code is open sourced on my GitHub account here https://github.com/bmwasaru/exif-scrubber

Here is how it looks on the desktop: