对aishell_transcript_v0.8.txt进行处理(去掉文本之间的空格,并且修改wav名称和文本之间的隔断为tap)
awk '{for(i=2;i<=NF;++i) printf $i; print "\n"}' aishell_transcript_v0.8.txt > ~/home/aishell/data/text
取wav编号,为合成text分词做准备
awk '{print $1}' aishell_transcript_v0.8.txt > ~/home/aishell/data/wav
将text中的空行去掉
grep -v '^$' text > text-c
将wav 和 text-c 重新连接起来,中间用 tap 分割
paste -d "\t" wav text-c > TRANS
效果展示如下
/student/home/gyc/home/aishell/data/TRANS
分词:
python word_segmentation.py word_seg_vocab.txt TRANS > out_text