alexandrainst / coral

Danish ASR and TTS models associated with the CoRal project.
MIT License
9 stars 1 forks source link

CoRal

Danish ASR and TTS datasets and models, as part of the CoRal project, funded by the Innovation Fund.


Documentation License LastCommit Code Coverage

Developers:

Installation

  1. Run make install, which installs Poetry (if it isn't already installed), sets up a virtual environment and all Python dependencies therein.
  2. Run source .venv/bin/activate to activate the virtual environment.
  3. Run make to see a list of available commands.

Usage

Finetuning an Acoustic Model for Automatic Speech Recognition (ASR)

You can use the finetune_asr_model script to finetune your own ASR model:

python src/scripts/finetune_asr_model.py [key=value]...

Here are some of the more important available keys:

See all the finetuning options in the config/asr_finetuning.yaml file.

Evaluating an Automatic Speech Recognition (ASR) Model

You can use the evaluate_model script to evaluate an ASR model:

python src/scripts/evaluate_model.py [key=value]...

Here are some of the more important available keys:

See all the evaluation options in the config/evaluation.yaml file.

You can produce a comparison plot of different models evaluated on the CoRal test dataset with detailed=True by running the following script:

python src/scripts/create_comparison_plot.py \
  -f EVALUATION_FILE [-f EVALUATION_FILE ...] [--metric METRIC]

Here the EVALUATION_FILE arguments are the paths to the evaluation files produced by evaluate_model.py (they end in -coral-scores.csv). The METRIC argument is the metric to compare on, which can be one of wer and cer, for the word error rate and character error rate, respectively. The default is cer.

Troubleshooting

If you're on MacOS and get an error saying something along the lines of "fatal error: 'lzma.h' file not found" then try the following and rerun make install afterwards:

export CPPFLAGS="-I$(brew --prefix)/include"