]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/kaldi.git/commitdiff
[egs] Fixes to the aishell (Mandarin) recipe (#1770)
authorXingyu Na <asr.naxingyu@gmail.com>
Wed, 19 Jul 2017 17:05:50 +0000 (01:05 +0800)
committerDaniel Povey <dpovey@gmail.com>
Wed, 19 Jul 2017 17:05:50 +0000 (13:05 -0400)
egs/aishell/s5/local/aishell_data_prep.sh
egs/aishell/s5/local/download_and_untar.sh
egs/aishell/s5/run.sh

index 052dc9f9b477f8d6e60b55bed8927c3764fb35f1..4747e4f4d82ca937d93b1931bc058e879cbaaad1 100755 (executable)
@@ -32,7 +32,7 @@ fi
 
 # find wav audio file for train, dev and test resp.
 find $aishell_audio_dir -iname "*.wav" > $tmp_dir/wav.flist
-n=`wc -l $tmp_dir/wav.flist`
+n=`cat $tmp_dir/wav.flist | wc -l`
 [ $n -ne 141925 ] && \
   echo Warning: expected 141925 data data files, found $n
 
@@ -45,10 +45,8 @@ rm -r $tmp_dir
 # Transcriptions preparation
 for dir in $train_dir $dev_dir $test_dir; do
   echo Preparing $dir transcriptions
-  sed -e 's/\.wav//' $dir/wav.flist | awk -F '/' '{print $NF}' |\
-    sort > $dir/utt.list
-  sed -e 's/\.wav//' $dir/wav.flist | awk -F '/' '{i=NF-1;printf("%s %s\n",$NF,$i)}' |\
-    sort > $dir/utt2spk_all
+  sed -e 's/\.wav//' $dir/wav.flist | awk -F '/' '{print $NF}' > $dir/utt.list
+  sed -e 's/\.wav//' $dir/wav.flist | awk -F '/' '{i=NF-1;printf("%s %s\n",$NF,$i)}' > $dir/utt2spk_all
   paste -d' ' $dir/utt.list $dir/wav.flist > $dir/wav.scp_all
   utils/filter_scp.pl -f 1 $dir/utt.list $aishell_text > $dir/transcripts.txt
   awk '{print $1}' $dir/transcripts.txt > $dir/utt.list
index 0189bad1d4a5c0c25c6393cd003748906247fa16..3578a1c0835198b4a89c0968a622f301533d68b5 100755 (executable)
@@ -15,7 +15,7 @@ if [ $# -ne 3 ]; then
   echo "Usage: $0 [--remove-archive] <data-base> <url-base> <corpus-part>"
   echo "e.g.: $0 /export/a05/xna/data www.openslr.org/resources/33 data_aishell"
   echo "With --remove-archive it will remove the archive after successfully un-tarring it."
-  echo "<corpus-part> can be one of: data_aishell, resource."
+  echo "<corpus-part> can be one of: data_aishell, resource_aishell."
 fi
 
 data=$1
@@ -28,7 +28,7 @@ if [ ! -d "$data" ]; then
 fi
 
 part_ok=false
-list="data_aishell resource"
+list="data_aishell resource_aishell"
 for x in $list; do
   if [ "$part" == $x ]; then part_ok=true; fi
 done
index 2c8207ec745a397eb661b5ab92ed1ed8d1374138..a99cb51c6565b124e0132054cd1ce96a60a22680 100755 (executable)
 data=/export/a05/xna/data
 data_url=www.openslr.org/resources/33
 
-. cmd.sh
+. ./cmd.sh
 
 local/download_and_untar.sh $data $data_url data_aishell || exit 1;
-local/download_and_untar.sh $data $data_url resource || exit 1;
+local/download_and_untar.sh $data $data_url resource_aishell || exit 1;
 
 # Lexicon Preparation,
 local/aishell_prepare_dict.sh $data/resource_aishell || exit 1;