#!/usr/bin/env bash | |
if [[ -z $2 ]]; then | |
echo "Usage: bleu output reference" | |
exit 1 | |
fi | |
output=$1 | |
refs=$2 | |
format=plain | |
grep "|||" $output > /dev/null | |
if [[ $? -eq 0 ]]; then | |
format=nbest | |
fi | |
numrefs=$(ls $refs* | wc -l) | |
verbose=0 | |
java -cp $JOSHUA/class -Dfile.encoding=utf8 -Djava.library.path=lib -Xmx256m -Xms256m -Djava.util.logging.config.file=logging.properties joshua.util.JoshuaEval -cand $output -format $format -ref $refs -rps $numrefs -m BLEU 4 closest -v 0 |