Skip to content

Commit

Permalink
Merge pull request kaldi-asr#7 from aarora8/madcat_ar_2
Browse files Browse the repository at this point in the history
Madcat ar 2
  • Loading branch information
aarora8 committed May 2, 2018
2 parents c08d1c7 + 8ce6cb6 commit 1b1c246
Show file tree
Hide file tree
Showing 50 changed files with 1,649 additions and 817 deletions.
7 changes: 5 additions & 2 deletions egs/callhome_diarization/v1/diarization/make_rttm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
# Apache 2.0.

"""This script converts a segments and labels file to a NIST RTTM
file. It handles overlapping segments (e.g. the output of a sliding-
window diarization system).
file. It creates flat segmentation (i.e. no overlapping regions)
from overlapping segments, e.g. the output of a sliding-window
diarization system. The speaker boundary between two overlapping
segments by different speakers is placed at the midpoint between
the end of the first segment and the start of the second segment.
The segments file format is:
<segment-id> <recording-id> <start-time> <end-time>
Expand Down
97 changes: 97 additions & 0 deletions egs/hkust/s5/local/chain/compare_wer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/bin/bash
# Copyright 2018 Emotech LTD (Author: Xuechen Liu)

# compare wer between diff. models in hkust chain directory
# exemplar usage: local/chain/compare_wer.sh --online exp/chain/tdnn_7h_sp
# note: this script is made quite general since we kinda wanna give more flexibility to
# users on adding affix for their own use when training models.

set -e
. ./cmd.sh
. ./path.sh

if [ $# == 0 ]; then
echo "Usage: $0: [--online] <dir1> [<dir2> ... ]"
echo "e.g.: $0 --online exp/chain/tdnn_7h_sp"
exit 1
fi

echo "# $0 $*"

include_online=false
if [ "$1" == "--online" ]; then
include_online=true
shift
fi

set_names() {
if [ $# != 1 ]; then
echo "compare_wer_general.sh: internal error"
exit 1 # exit the program
fi
dirname=$(echo $1 | cut -d: -f1)
}

# print model names
echo -n "# Model "
for x in $*; do
printf "% 10s" " $(basename $x)"
done
echo

# print decode WER results
echo -n "# WER(%) "
for x in $*; do
set_names $x
wer=$([ -d $x ] && grep WER $x/decode/cer_* | utils/best_wer.sh | awk '{print $2}')
printf "% 10s" $wer
done
echo

# so how about online WER?
if $include_online; then
echo -n "# WER(%)[online] "
for x in $*; do
set_names $x
wer=$(cat ${x}_online/decode/cer_* | utils/best_wer.sh | awk '{print $2}')
printf "% 10s" $wer
done
echo
echo -n "# WER(%)[per-utt] "
for x in $*; do
set_names $x
wer_per_utt=$(cat ${x}_online/decode_per_utt/cer_* | utils/best_wer.sh | awk '{print $2}')
printf "% 10s" $wer_per_utt
done
echo
fi

# print final log prob for train & validation
echo -n "# Final train prob "
for x in $*; do
prob=$(grep Overall $x/log/compute_prob_train.final.log | grep -v xent | awk '{printf($8)}' | cut -c1-7)
printf "% 10s" $prob
done
echo

echo -n "# Final valid prob "
for x in $*; do
prob=$(grep Overall $x/log/compute_prob_valid.final.log | grep -v xent | awk '{printf($8)}' | cut -c1-7)
printf "% 10s" $prob
done
echo

# do the same for xent objective
echo -n "# Final train prob (xent)"
for x in $*; do
prob=$(grep Overall $x/log/compute_prob_train.final.log | grep -w xent | awk '{printf("%.4f", $8)}')
printf "% 10s" $prob
done
echo

echo -n "# Final valid prob (xent)"
for x in $*; do
prob=$(grep Overall $x/log/compute_prob_valid.final.log | grep -w xent | awk '{printf("%.4f", $8)}')
printf "% 10s" $prob
done
echo
209 changes: 0 additions & 209 deletions egs/hkust/s5/local/chain/run_tdnn.sh

This file was deleted.

1 change: 1 addition & 0 deletions egs/hkust/s5/local/chain/run_tdnn.sh
Loading

0 comments on commit 1b1c246

Please sign in to comment.