diff --git a/examples/text_frontend/README.md b/examples/text_frontend/README.md index d41e428..168df46 100644 --- a/examples/text_frontend/README.md +++ b/examples/text_frontend/README.md @@ -11,6 +11,10 @@ For text normalization, the test data is `data/textnorm_test_cases.txt`, we use We use `CER` as evaluation criterion. ## Start +If you want to use sclite to get more detail information of WER, you should run the command below to make sclite first. +```bash +./make_sclite.sh +``` Run the command below to get the results of test. ```bash ./run.sh diff --git a/examples/text_frontend/make_sclite.sh b/examples/text_frontend/make_sclite.sh new file mode 100755 index 0000000..db8c921 --- /dev/null +++ b/examples/text_frontend/make_sclite.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ ! -d "./SCTK" ];then + echo "Clone SCTK ..." + git clone https://github.com/usnistgov/SCTK + echo "Clone SCTK done!" +fi + +if [ ! -d "./SCTK/bin" ];then + echo "Start make SCTK ..." + pushd SCTK && make config && make all && make check && make install && make doc && popd + echo "SCTK make done!" +fi diff --git a/examples/text_frontend/run.sh b/examples/text_frontend/run.sh index b84325c..9882b05 100755 --- a/examples/text_frontend/run.sh +++ b/examples/text_frontend/run.sh @@ -1,19 +1,7 @@ #!/bin/bash + USE_SCLITE=true -if [ "$USE_SCLITE" = true ];then - if [ ! -d "./SCTK" ];then - echo "Clone SCTK ..." - git clone https://github.com/usnistgov/SCTK - echo "Clone SCTK done!" - fi - - if [ ! -d "./SCTK/bin" ];then - echo "Start make SCTK ..." - pushd SCTK && make config && make all && make check && make install && make doc && popd - echo "SCTK make done!" - fi -fi # test g2p echo "Start get g2p test data ..." python3 get_g2p_data.py --root-dir=~/datasets/BZNSYP --output-dir=data/g2p @@ -29,9 +17,9 @@ python3 test_textnorm.py --input-dir=data/textnorm --output-dir=exp/textnorm # whether use sclite to get more detail information of WER if [ "$USE_SCLITE" = true ];then echo "Start sclite g2p ..." - ./SCTK/bin/sclite -i wsj -r ./exp/g2p/text.ref.clean -h ./exp/g2p/text.g2p -e utf-8 -o all + ./SCTK/bin/sclite -i wsj -r ./exp/g2p/text.ref.clean trn -h ./exp/g2p/text.g2p trn -e utf-8 -o all echo echo "Start sclite textnorm ..." - ./SCTK/bin/sclite -i wsj -r ./exp/textnorm/text.ref.clean -h ./exp/textnorm/text.tn -e utf-8 -o all + ./SCTK/bin/sclite -i wsj -r ./exp/textnorm/text.ref.clean trn -h ./exp/textnorm/text.tn trn -e utf-8 -o all fi \ No newline at end of file