📄 nbest-error
字号:
#!/bin/sh## nbest-error --# compute minimum error of nbest lists## $Header: /home/srilm/devel/utils/src/RCS/nbest-error,v 1.5 2003/01/11 01:25:44 stolcke Exp $#if [ $# -lt 2 ]; then echo "usage: $0 score-dir refs [nbest-lattice-option ...]" >&2 echo " or $0 file-list refs [nbest-lattice-option ...]" >&2 exit 2fiscoredir="$1"refs="$2"shift; shiftoption=-nbest-errorcase "$*" in*-lattice-error*) option= ;;esacif [ ! -r $scoredir ]; then echo "$0: cannot access $scoredir" >&2 exit 1fiif [ ! -r $refs ]; then echo "$0: cannot access $refs" >&2 exit 1fiif [ -d $scoredir ]; then find $scoredir -follow \ -type f \( -name \*.score -o \ -name \*.Z -o \ -name \*.gz \) \ -print | sortelse cat $scoredirfi | \nbest-lattice -nbest-files - -refs $refs $option "$@" | \gawk '$2 ~ /^[0-9]*$/ && $10 ~ /^[0-9]*$/ && $9 == "words" { nsents ++; nwords += $10; nerrors += $2; print;}END { printf "%d sentences, %d words, %d errors (%.2f%%)\n", \ nsents, nwords, nerrors, 100*nerrors/nwords;}'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -