From d864da4d65fdfb05e24db79fe67e72093d2adf7c Mon Sep 17 00:00:00 2001 From: Triplecq Date: Thu, 25 Jan 2024 01:25:28 +0900 Subject: [PATCH] validation scripts --- egs/reazonspeech/ASR/decode_greedy.sh | 7 ++++--- egs/reazonspeech/ASR/decode_modified_beam.sh | 11 ++++++----- egs/reazonspeech/ASR/summary.sh | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100755 egs/reazonspeech/ASR/summary.sh diff --git a/egs/reazonspeech/ASR/decode_greedy.sh b/egs/reazonspeech/ASR/decode_greedy.sh index 159341d61..4f24d0a4e 100755 --- a/egs/reazonspeech/ASR/decode_greedy.sh +++ b/egs/reazonspeech/ASR/decode_greedy.sh @@ -1,5 +1,5 @@ num_epochs=30 -for ((i=$num_epochs; i>=1; i--)); +for ((i=$num_epochs; i>=15; i--)); do for ((j=1; j<=$i; j++)); do @@ -7,8 +7,9 @@ do --epoch $i \ --avg $j \ --exp-dir zipformer/exp \ - --max-duration 300 \ + --max-duration 450 \ --lang data/lang_char \ - --decoding-method greedy_search + --decoding-method greedy_search \ + --blank-penalty 2 done done diff --git a/egs/reazonspeech/ASR/decode_modified_beam.sh b/egs/reazonspeech/ASR/decode_modified_beam.sh index 3fd91de32..a3a0c25a0 100755 --- a/egs/reazonspeech/ASR/decode_modified_beam.sh +++ b/egs/reazonspeech/ASR/decode_modified_beam.sh @@ -1,14 +1,15 @@ num_epochs=30 -for ((i=$num_epochs; i>=1; i--)); +for ((i=$num_epochs; i>=20; i--)); do - for ((j=1; j<=$i; j++)); + for avg in 12 11 10 9 8 7 6 5; do python3 ./zipformer/decode.py \ --epoch $i \ - --avg $j \ + --avg $avg \ --exp-dir zipformer/exp \ - --max-duration 300 \ + --max-duration 450 \ --lang data/lang_char \ - --decoding-method modified_beam_search + --decoding-method modified_beam_search \ + --blank-penalty 2.5 done done diff --git a/egs/reazonspeech/ASR/summary.sh b/egs/reazonspeech/ASR/summary.sh new file mode 100755 index 000000000..3f708aeff --- /dev/null +++ b/egs/reazonspeech/ASR/summary.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +summary_file="summary_results.txt" +> "$summary_file" + +for file in wer-summary-valid-*-epoch-*-avg-*.txt; do + # Extract epoch and avg values from the filename + epoch=$(echo "$file" | grep -oP 'epoch-\K[0-9]+') + avg=$(echo "$file" | grep -oP 'avg-\K[0-9]+') + + # Extract the WER value from the second line of the file + wer=$(awk 'NR==2 {print $2}' "$file") + + # Append the results to the summary file + echo "epoch $epoch avg $avg greedy_search $wer" >> "$summary_file" +done