Skip to content

Commit 5a3b8b1

Browse files
committed
fixing some issues
1 parent 6c69189 commit 5a3b8b1

File tree

7 files changed

+37
-28
lines changed

7 files changed

+37
-28
lines changed
File renamed without changes.

egs/chime5/s5/conf/decode.config

Lines changed: 0 additions & 2 deletions
This file was deleted.

egs/chime5/s5/local/check_tools.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@
1717

1818
[ -f ./path.sh ] && . ./path.sh
1919

20-
uconv=`command -v uconv 2>/dev/null` \
20+
command -v uconv &>/dev/null \
2121
|| { echo >&2 "uconv not found on PATH. You will have to install ICU4C"; exit 1; }
2222

23-
srilm=`command -v ngram 2>/dev/null` \
23+
command -v ngram &>/dev/null \
2424
|| { echo >&2 "srilm not found on PATH. Please use the script $KALDI_ROOT/tools/extras/install_srilm.sh to install it"; exit 1; }
2525

26+
if [ -z ${LIBLBFGS} ]; then
27+
echo >&2 "SRILM is not compiled with the support of MaxEnt models."
28+
echo >&2 "You should use the script in \$KALDI_ROOT/tools/install_srilm.sh"
29+
echo >&2 "which will take care of compiling the SRILM with MaxEnt support"
30+
exit 1;
31+
fi
32+
2633
sox=`command -v sox 2>/dev/null` \
2734
|| { echo >&2 "sox not found on PATH. Please install it manually (you will need version 14.4.0 and higher)."; exit 1; }
2835

@@ -35,10 +42,10 @@ if [ ! -z "$sox" ]; then
3542
fi
3643
fi
3744

38-
phalign=`command -v phonetisaurus-align 2>/dev/null` \
45+
command -v phonetisaurus-align &>/dev/null \
3946
|| { echo >&2 "Phonetisaurus not found on PATH. Please use the script $KALDI_ROOT/tools/extras/install_phonetisaurus.sh to install it"; exit 1; }
4047

41-
beamformit=`command -v BeamformIt 2>/dev/null` \
48+
command -v BeamformIt &>/dev/null \
4249
|| { echo >&2 "BeamformIt not found on PATH. Please use the script $KALDI_ROOT/tools/extras/install_beamformit.sh to install it"; exit 1; }
4350

4451
exit 0

egs/chime5/s5/local/prepare_data.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,26 @@ if [ $# -ne 3 ] ; then
2020
exit 1
2121
fi
2222

23+
set -e -o pipefail
24+
2325
adir=$1
2426
jdir=$2
2527
dir=$3
2628

29+
json_count=$(find $jdir -name "*.json" | wc -l)
30+
wav_count=$(find $adir -name "*.wav" | wc -l)
31+
32+
if [ "$json_count" -eq 0 ]; then
33+
echo >&2 "We expect that the directory $jdir will contain json files."
34+
echo >&2 "That implies you have supplied a wrong path to the data."
35+
exit 1
36+
fi
37+
if [ "$wav_count" -eq 0 ]; then
38+
echo >&2 "We expect that the directory $adir will contain wav files."
39+
echo >&2 "That implies you have supplied a wrong path to the data."
40+
exit 1
41+
fi
42+
2743
echo "$0: Converting transcription to text"
2844

2945
mkdir -p $dir

egs/chime5/s5/local/prepare_dict.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ awk '{print $1}' $dir/iv_lexicon.txt | \
8787
if (!defined $seen{$w}) { print; }
8888
} ' $dir/word_counts > $dir/oov_counts.txt
8989

90-
set -x
9190
echo "*Highest-count OOVs (including fragments) are:"
9291
head -n 10 $dir/oov_counts.txt
9392
echo "*Highest-count OOVs (excluding fragments) are:"

egs/chime5/s5/local/run_beamformit.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ odir=$2
2525
array=$3
2626
expdir=exp/enhan/`echo $odir | awk -F '/' '{print $NF}'`_`echo $bmf | tr ' ' '_'`
2727

28-
if [ -z $BEAMFORMIT ] ; then
29-
export BEAMFORMIT=$KALDI_ROOT/tools/BeamformIt
28+
if ! command -v BeamformIt &>/dev/null ; then
29+
echo "Missing BeamformIt, run 'cd $KALDI_ROOT/tools/; ./extras/install_beamformit.sh; cd -;'" && exit 1
3030
fi
31-
export PATH=${PATH}:$BEAMFORMIT
32-
! hash BeamformIt && echo "Missing BeamformIt, run 'cd $KALDI_ROOT/tools/; ./extras/install_beamformit.sh; cd -;'" && exit 1
3331

3432
# Set bash to 'debug' mode, it will exit on :
3533
# -e 'error', -u 'undefined variable', -o ... 'error in pipeline', -x 'print commands',
@@ -75,7 +73,7 @@ for n in `seq $nj`; do
7573
cat << EOF > $expdir/log/beamform.$n.sh
7674
while read line; do
7775
$BEAMFORMIT/BeamformIt -s \$line -c $input_arrays \
78-
--config_file `pwd`/conf/chime5.cfg \
76+
--config_file `pwd`/conf/beamformit.cfg \
7977
--source_dir $sdir \
8078
--result_dir $odir
8179
done < $output_wavfiles.$n

egs/chime5/s5/local/train_lms_srilm.sh

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,9 @@ tgtdir=$2
4040
##End of configuration
4141
loc=`which ngram-count`;
4242
if [ -z $loc ]; then
43-
if uname -a | grep 64 >/dev/null; then # some kind of 64 bit...
44-
sdir=`pwd`/../../../tools/srilm/bin/i686-m64
45-
else
46-
sdir=`pwd`/../../../tools/srilm/bin/i686
47-
fi
48-
if [ -f $sdir/ngram-count ]; then
49-
echo Using SRILM tools from $sdir
50-
export PATH=$PATH:$sdir
51-
else
52-
echo You appear to not have SRILM tools installed, either on your path,
53-
echo or installed in $sdir. See tools/install_srilm.sh for installation
54-
echo instructions.
55-
exit 1
56-
fi
43+
echo >&2 "You appear to not have SRILM tools installed, either on your path,"
44+
echo >&2 "Use the script \$KALDI_ROOT/tools/install_srilm.sh to install it."
45+
exit 1
5746
fi
5847

5948
# Prepare the destination directory
@@ -122,7 +111,6 @@ else
122111
echo train.txt contains `cat $tgtdir/train.txt | perl -ane 'BEGIN{$w=$s=0;}{$w+=@F; $s++;}END{print "$w words, $s sentences\n";}'`
123112
fi
124113

125-
set -x
126114
# Kaldi transcript files contain Utterance_ID as the first word; remove it
127115
sed -e "s/\.CH.//" -e "s/_.\-./_/" $dev_text | sort -u | \
128116
perl -ane 'print join(" ", @F[1..$#F]) . "\n" if @F > 1' > $tgtdir/dev.txt
@@ -247,7 +235,10 @@ if [ ! -z ${LIBLBFGS} ]; then
247235
ngram -lm - -order 4 -unk -map-unk "$oov_symbol" -prune-lowprobs -write-lm - |\
248236
sed 's/<unk>/'${oov_symbol}'/g' | gzip -c > $tgtdir/4gram.me.gz || exit 1
249237
else
250-
echo "Skipping MaxEnt models"
238+
echo >&2 "SRILM is not compiled with the support of MaxEnt models."
239+
echo >&2 "You should use the script in \$KALDI_ROOT/tools/install_srilm.sh"
240+
echo >&2 "which will take care of compiling the SRILM with MaxEnt support"
241+
exit 1;
251242
fi
252243

253244

0 commit comments

Comments
 (0)