# Automatic Speech Recognition for Luganda
We trained the Automatic Speech Recognition for Luganda model
as part of Mozilla Luganda Automatic Speech Recognition Competition.
Our model achieve the Word Error Rate (WER) of **7.37%** on Mozilla Common Voice version 6.1
and **7.53%** on Mozilla Common Voice version 7.0.
We use several python scripts to do the training/fine-tuning, evaluation and the creation of submission file:
- run_finetuning.py
- run_evaluation.py
- run_submission.py
We prepared a jupyter notebook to run all these tasks in Google Colab.
## Dataset
We trained the model using Mozilla Common Voice
dataset version 7.0 for Luganda.
The test dataset can be downloaded from Mozilla Luganda - ASR dataset.
## Model Training
We have fine-tuned the Facebook Wav2Vec2 model with the Luganda Common Voice dataset and stored it in indonesian-nlp/wav2vec2-lug…. The model has been trained for 200 epochs in 4 hours and 30 minutes using 8 GPUs.
We use the script run_finetuning.py to train the model.
Due to resource and time limitation in Google Colab,
we skip the model training here, but we run the evaluation and creation of the submission file. However, feel free to run following command for testing purpose:
```!python run_finetuning.py finetuning_common_voice_1epoch.json```
It will run the training for only one epoch which will take around 2 hours in Google Colab.
### Usage
For training using single GPU
```
% python run_finetuning.py
```
For training using multi GPUs, for example 8 GPUs.
```
% python -m torch.distributed.launch --nproc_per_node=8 run_finetuning.py
```
Our model "indonesian-nlp/wav2vec2-luganda" has been trained using following command:
```
% python -m torch.distributed.launch --nproc_per_node=8 run_finetuning.py finetuning_common_voice.json
```
List of possible arguments:
```
% python run_finetuning.py -h
```
## Model Evaluation
To test our fine-tuned model, we evaluate it with test split of Mozilla Common Voice d …