Skip to content

Instantly share code, notes, and snippets.

@desh2608
Created June 19, 2023 17:58
Show Gist options
  • Save desh2608/51d3449351fab053a0f9b597e46a8685 to your computer and use it in GitHub Desktop.
Save desh2608/51d3449351fab053a0f9b597e46a8685 to your computer and use it in GitHub Desktop.
How to create a CTM file using forced alignments in Kaldi
#!/usr/bin/env bash
. ./cmd.sh
. ./path.sh
# Train systems,
nj=30 # number of parallel jobs,
stage=0
dsets="dev test"
. utils/parse_options.sh
mkdir -p tedlium_ctm
for dset in $dsets; do
steps/align_fmllr.sh --nj $nj --cmd "$train_cmd" \
data/$dset data/lang exp/tri3_cleaned exp/tri3_cleaned_${dset}_ali || exit 1
steps/get_train_ctm.sh --cmd "$train_cmd" \
data/$dset data/lang exp/tri3_cleaned_${dset}_ali || exit 1
cp exp/tri3_cleaned_${dset}_ali/ctm tedlium_ctm/${dset}.ctm
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment