From 2e228a24815216d36cc6b3cce2f15fc88197a926 Mon Sep 17 00:00:00 2001
From: 嘉渊 <wangjiaming.wjm@alibaba-inc.com>
Date: 星期五, 26 五月 2023 10:08:45 +0800
Subject: [PATCH] update repo

---
 egs/wenetspeech/conformer/run.sh |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/egs/wenetspeech/conformer/run.sh b/egs/wenetspeech/conformer/run.sh
index a79e5c5..9f6e4ae 100644
--- a/egs/wenetspeech/conformer/run.sh
+++ b/egs/wenetspeech/conformer/run.sh
@@ -20,7 +20,7 @@
 type=sound
 scp=wav.scp
 speed_perturb="0.9 1.0 1.1"
-stage=1
+stage=0
 stop_stage=5
 
 # feature configuration
@@ -41,6 +41,7 @@
 set -u
 set -o pipefail
 
+set=L
 train_set=train_l
 valid_set=dev
 test_sets="dev test_net test_meeting"
@@ -71,7 +72,7 @@
 if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
     echo "stage 0: Data preparation"
     # Data preparation
-    local/wenetspeech_data_prep.sh $raw_data $feats_dir
+#    local/data.sh --set ${set} --nj $nj --data_dir $feats_dir --WENETSPEECH $raw_data --train_cmd $train_cmd
     mkdir $feats_dir/data
     mv $feats_dir/$train_set $feats_dir/data/$train_set
     for x in $test_sets; do
@@ -81,5 +82,20 @@
 
 if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
     echo "stage 1: Feature and CMVN Generation"
-    utils/compute_cmvn.sh ${feats_dir}/data/${train_set} --cmd "$train_cmd" --nj $nj --feats_dim ${feats_dim} --config "$asr_config" --scale 0.1
+    utils/compute_cmvn.sh --fbankdir ${feats_dir}/data/${train_set} --cmd "$train_cmd" --nj $nj --feats_dim ${feats_dim} --config_file "$asr_config" --scale 0.1
+fi
+
+token_list=${feats_dir}/data/${lang}_token_list/$token_type/tokens.txt
+echo "dictionary: ${token_list}"
+if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
+    echo "stage 2: Dictionary Preparation"
+    mkdir -p ${feats_dir}/data/${lang}_token_list/$token_type/
+
+    echo "make a dictionary"
+    echo "<blank>" > ${token_list}
+    echo "<s>" >> ${token_list}
+    echo "</s>" >> ${token_list}
+    utils/text2token.py -s 1 -n 1 --space "" ${feats_dir}/data/$train_set/text | cut -f 2- -d" " | tr " " "\n" \
+        | sort | uniq | grep -a -v -e '^\s*$' | awk '{print $0}' >> ${token_list}
+    echo "<unk>" >> ${token_list}
 fi

--
Gitblit v1.9.1