Logo Lanfrica

Digital-Umuganda/STT-Kinyarwanda

Domain:

natural language processing

Record type:

software
Creator:
Digital Umuganda
Host:
A Speech To Text in Kinyarwanda trained using coqui STT # Kinyarwanda STT ## Introduction This README is a quick-start guide to training or finetuning an STT model using the Coqui toolkit on the Kinyarwanda speech data. ## Dockerfile Setup (Recommended) To avoid problems setting up Coqui STT on your environment and compatibility issues, we recommend pulling or building the Coqui STT dockerfile from the `stt-train:latest` image: ```bash $ git clone --recurse-submodules github.com $ cd STT $ docker build -f Dockerfile.train . -t stt-train:latest $ docker run -it stt-train:latest ``` ## Data Preprocessing ### Data Formatting After downloading and extracting the dataset, we found the following contents: - `.tsv` files, containing metadata such as text transcripts - `.mp3` audio files, located in the clips directory Coqui STT cannot directly work with Common Voice data, so we need the Coqui importer script bin/import_cv2.py to format the data correctly: ```bash $ bin/import_cv2.py --validate_label_locale /path/to/validate_locale_rw.py /path/to/extracted/common-voice/archive ``` The importer script above would create `.csv` files from the `.tsv` files, and `.wav` files from the `.mp3` files. The `--validate_label_locale` flag is optional but needed for data cleaning. The details on the input to the flag can be found in the data cleaning section below. ### Data Cleaning 1. As a way to clean the data, we need to validate the text. It checks a sentence to see if it can be converted and if possible normalizes the encoding, removes special characters, etc. For this we use the commonvoice-utils tool to clean the text for Kinyarwanda (rw). The file (script) below is passed as an argument to the `--validate_label_locale` flag in the importer command above ```python #validate_locale_rw.py from cvutils import Validator def validate_label(label): v = Validator("rw") #rw - locale for Kinyarwanda. You should change accordingly. return v.validate(label) ``` 1. We also need to ensure that each audio/input is lo …