Skip to content

Commit

Permalink
Fix to EMS call of multi-bleu evaluation script
Browse files Browse the repository at this point in the history
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3798 1f5c12ca-751b-0410-a591-d2e778427230
  • Loading branch information
suzyh committed Jan 13, 2011
1 parent caa9dd0 commit c901310
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 9 additions & 2 deletions scripts/ems/experiment.meta
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,19 @@ ibm-bleu-c
rerun-on-change: ibm-bleu-c
template: $ibm-bleu-c -s $input-sgm -r IN1 -t IN > OUT
multi-bleu
in: recased-output reference
in: cleaned-output reference
out: multi-bleu-score
default-name: evaluation/multi-bleu
ignore-unless: multi-bleu
rerun-on-change: multi-bleu
template: $multi-bleu IN1 < IN > OUT
multi-bleu-c
in: recased-output tokenized-reference
out: multi-bleu-c-score
default-name: evaluation/multi-bleu-c
ignore-unless: multi-bleu-c
rerun-on-change: multi-bleu-c
template: $multi-bleu-c IN1 < IN > OUT
ter
in: wrapped-output reference-sgm
out: ter-score
Expand Down Expand Up @@ -740,6 +747,6 @@ analysis-coverage

[REPORTING] single
report
in: EVALUATION:nist-bleu-score EVALUATION:nist-bleu-c-score EVALUATION:multi-bleu-score EVALUATION:meteor-score EVALUATION:ter-score EVALUATION:wer-score EVALUATION:ibm-bleu-score EVALUATION:ibm-bleu-c-score EVALUATION:analysis EVALUATION:analysis-coverage
in: EVALUATION:nist-bleu-score EVALUATION:nist-bleu-c-score EVALUATION:multi-bleu-score EVALUATION:multi-bleu-c-score EVALUATION:meteor-score EVALUATION:ter-score EVALUATION:wer-score EVALUATION:ibm-bleu-score EVALUATION:ibm-bleu-c-score EVALUATION:analysis EVALUATION:analysis-coverage
out: report
default-name: evaluation/report
9 changes: 5 additions & 4 deletions scripts/ems/support/report-experiment-scores.perl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$TYPE{"nist-bleu"} = "BLEU";
$TYPE{"multi-bleu"} = "BLEU";
$TYPE{"nist-bleu-c"} = "BLEU-c";
$TYPE{"multi-bleu-c"}= "BLEU-c";
$TYPE{"ibm-bleu"} = "IBM";
$TYPE{"ibm-bleu-c"} = "IBM-c";

Expand Down Expand Up @@ -52,8 +53,8 @@ sub process {
elsif ($type eq 'ibm-bleu' || $type eq 'ibm-bleu-c') {
$SCORE{$set} .= &extract_ibm_bleu($file,$type)." ";
}
elsif ($type eq 'multi-bleu') {
$SCORE{$set} .= &extract_multi_bleu($file)." ";
elsif ($type eq 'multi-bleu' || $type eq 'multi-bleu-c') {
$SCORE{$set} .= &extract_multi_bleu($file,$type)." ";
}
}

Expand Down Expand Up @@ -96,7 +97,7 @@ sub extract_ibm_bleu {
}

sub extract_multi_bleu {
my ($file) = @_;
my ($file,$type) = @_;
my ($bleu,$ratio);
foreach (`cat $file`) {
$bleu = $1 if /BLEU = (\S+), /;
Expand All @@ -107,5 +108,5 @@ sub extract_multi_bleu {

$AVERAGE{"multi-bleu"} += $bleu;

return $output."BLEU";
return $output.$TYPE{$type};
}

0 comments on commit c901310

Please sign in to comment.