Skip to content

Commit

Permalink
[egs] Replace bc with perl -e (kaldi-asr#3093)
Browse files Browse the repository at this point in the history
  • Loading branch information
entn-at authored and danpovey committed Mar 12, 2019
1 parent abd4869 commit 9c8ba0f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if [ $stage -le 0 ]; then
fi
utils/data/get_uniform_subsegments.py \
--max-segment-duration=$window \
--overlap-duration=$(echo "$window-$period" | bc) \
--overlap-duration=$(perl -e "print ($window-$period);") \
--max-remaining-duration=$min_segment \
--constant-duration=True \
$segments > $dir/subsegments
Expand Down
2 changes: 1 addition & 1 deletion egs/callhome_diarization/v1/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ if [ $stage -le 6 ]; then

der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
exp/tuning/${dataset}_t${threshold})
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
best_der=$der
best_threshold=$threshold
fi
Expand Down
2 changes: 1 addition & 1 deletion egs/callhome_diarization/v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ if [ $stage -le 10 ]; then

der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
$nnet_dir/tuning/${dataset}_t${threshold})
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
best_der=$der
best_threshold=$threshold
fi
Expand Down
2 changes: 1 addition & 1 deletion egs/dihard_2018/v1/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ if [ $stage -le 7 ]; then

der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
$ivec_dir/tuning/dihard_2018_dev_t${threshold})
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
best_der=$der
best_threshold=$threshold
fi
Expand Down
2 changes: 1 addition & 1 deletion egs/dihard_2018/v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ if [ $stage -le 12 ]; then

der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
$nnet_dir/tuning/dihard_2018_dev_t${threshold})
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
best_der=$der
best_threshold=$threshold
fi
Expand Down
4 changes: 2 additions & 2 deletions egs/sre08/v1/local/score_sre08.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ tot_eer=0.0
printf '% 12s' 'EER:'
for condition in $(seq 8); do
eer=$(awk '{print $3}' $scores | paste - $trials | awk -v c=$condition '{n=4+c; if ($n == "Y") print $1, $4}' | compute-eer - 2>/dev/null)
tot_eer=$(echo "$tot_eer+$eer" | bc)
tot_eer=$(perl -e "print ($tot_eer+$eer);")
eers[$condition]=$eer
done

eers[0]=$(echo "$tot_eer/8" | bc -l)
eers[0]=$(perl -e "print ($tot_eer/8.0);")

for i in $(seq 0 8); do
printf '% 7.2f' ${eers[$i]}
Expand Down

0 comments on commit 9c8ba0f

Please sign in to comment.