Blame view

egs/gp/s1/utils/score_text.sh 611 Bytes
8dcb6dfcb   Yannick Estève   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  #!/bin/bash
  # Copyright 2010-2011 Microsoft Corporation
  
  if [ -f ./path.sh ]; then . ./path.sh; fi
  
  if [ $# -ne 2 ]; then
     echo "Usage: scripts/score_text.sh <decode-dir> <data-dir>"
     exit 1;
  fi
  
  dir=$1
  data=$2
  
  if [ ! -f $data/text ]; then
    echo Could not find transcriptions in $data/text
    exit 1
  fi
  
  
  cat $data/text | sed 's:<NOISE>::g' |  sed 's:<SPOKEN_NOISE>::g' > $dir/test_trans.filt
  
  # We assume the transcripts are already in integer form.
  cat $dir/*.txt |  sed 's:<UNK>::g' > $dir/text
  
  compute-wer --text --mode=present ark:$dir/test_trans.filt ark,p:$dir/text >& $dir/wer
  
  grep WER $dir/wer