summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--training/dtrain/score.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/training/dtrain/score.h b/training/dtrain/score.h
index a9c60b64..748b3317 100644
--- a/training/dtrain/score.h
+++ b/training/dtrain/score.h
@@ -356,14 +356,14 @@ class LiangBleuScorer : public Scorer
break;
} else {
weight_t i_score = log((weight_t)counts.clipped[i]/counts.sum[i]);
- for (size_t j=i; j < M; j++) {
+ for (size_t j=i; j<M; j++) {
i_bleu[j] += (1/((weight_t)j+1)) * i_score;
}
}
- sum += exp(i_bleu[i])/pow(2.0, (double)(N_-i+2));
+ sum += exp(i_bleu[i])/pow(2.0, (double)(N_-i));
}
- return brevity_penalty(hl, hl) * sum;
+ return brevity_penalty(hl, rl) * sum;
}
};