diff options
-rwxr-xr-x | scripts/training/mert-moses.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/training/mert-moses.pl b/scripts/training/mert-moses.pl index 5a2160a67..04e174c1b 100755 --- a/scripts/training/mert-moses.pl +++ b/scripts/training/mert-moses.pl @@ -1127,7 +1127,16 @@ if($___RETURN_BEST_DEV) { my $bestbleu=0; my $evalout = "eval.out"; for (my $i = 1; $i < $run; $i++) { - my $cmd = "$mert_eval_cmd --reference " . join(",", @references) . " $mert_extract_args --nbest run$i.best$___N_BEST_LIST_SIZE.out.gz"; + my $candidate; + if ($___HG_MIRA) { + die "File not found: run$i.out" unless -r "run$i.out"; + $candidate = "--candidate run$i.out"; + } + else { + die "File not found: run$i.best$___N_BEST_LIST_SIZE.out.gz" unless -r "run$i.best$___N_BEST_LIST_SIZE.out.gz"; + $candidate = "--nbest run$i.best$___N_BEST_LIST_SIZE.out.gz"; + } + my $cmd = "$mert_eval_cmd --reference " . join(",", @references) . " $mert_extract_args $candidate"; $cmd .= " -l $__REMOVE_SEGMENTATION" if defined( $__PROMIX_TRAINING); safesystem("$cmd 2> /dev/null 1> $evalout"); open my $fh, '<', $evalout or die "Can't read $evalout : $!"; |