Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Sennrich <rico.sennrich@gmx.ch>2015-02-27 17:33:03 +0300
committerRico Sennrich <rico.sennrich@gmx.ch>2015-02-27 17:47:37 +0300
commite2b1ac1e9d955c55cab5000eccc7b052f196a90b (patch)
treeaefe0b9437ac4e858d7fc1eb991be454a32547bd
parent0d4678577b45a154cf864d99e88f697698078b1b (diff)
fix option --return-best-dev with hypergraph MIRA (which I broke in commit d39cbca0b9)pre-MMT
-rwxr-xr-xscripts/training/mert-moses.pl11
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 : $!";