Fujimoto Seiji c1ce7ca9e3 Add first cut at ReazonSpeech recipe
This recipe is mostly based on egs/csj, but tweaked to the point that
can be run with ReazonSpeech corpus.

That being said, there are some big caveats:

 * Currently the model quality is not very good. Actually, it is very
   bad. I trained a model with 1000h corpus, and it resulted in >80%
   CER on JSUT.

 * The core issue seems that Zipformer is prone to ignore untterances
   as sielent segments. It often produces an empty hypothesis despite
   that the audio actually contains human voice.

 * This issue is already reported in the upstream and not fully
   resolved yet as of Dec 2023.

Signed-off-by: Fujimoto Seiji <fujimoto@ceptord.net>
2023-12-18 16:12:11 +09:00

53 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# fix segmentation fault reported in https://github.com/k2-fsa/icefall/issues/674
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
set -eou pipefail
nj=8
stage=-1
stop_stage=100
reazonspeech_dir=corpus
reazonspeech_manifest_dir=data
. shared/parse_options.sh || exit 1
mkdir -p data
log() {
local fname=${BASH_SOURCE[1]##*/}
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
}
if [ $stage -le 1 ] && [ $stop_stage -ge 1 ]; then
log "Stage 1: Prepare ReazonSpeech manifest"
if [ ! -e $reazonspeech_manifest_dir/.reazonspeech.done ]; then
lhotse prepare reazonspeech $reazonspeech_dir $reazonspeech_manifest_dir
touch $reazonspeech_manifest_dir/.reazonspeech.done
fi
fi
if [ $stage -le 2 ] && [ $stop_stage -ge 2 ]; then
log "Stage 2: Compute ReazonSpeech fbank"
if [ ! -e $reazonspeech_manifest_dir/.reazonspeech-validated.done ]; then
python local/compute_fbank_reazonspeech.py --manifest-dir $reazonspeech_manifest_dir
python local/validate_manifest.py --manifest $reazonspeech_manifest_dir/reazonspeech_cuts_train.jsonl.gz
python local/validate_manifest.py --manifest $reazonspeech_manifest_dir/reazonspeech_cuts_valid.jsonl.gz
python local/validate_manifest.py --manifest $reazonspeech_manifest_dir/reazonspeech_cuts_test.jsonl.gz
touch $reazonspeech_manifest_dir/.reazonspeech-validated.done
fi
fi
if [ $stage -le 3 ] && [ $stop_stage -ge 3 ]; then
log "Stage 3: Prepare ReazonSpeech lang_char"
python local/prepare_lang_char.py $reazonspeech_manifest_dir/reazonspeech_cuts_train.jsonl.gz
fi
if [ $stage -le 4 ] && [ $stop_stage -ge 4 ]; then
log "Stage 4: Show manifest statistics"
python local/display_manifest_statistics.py --manifest-dir $reazonspeech_manifest_dir > $reazonspeech_manifest_dir/manifest_statistics.txt
cat $reazonspeech_manifest_dir/manifest_statistics.txt
fi