diff options
author | Colin Cherry <colin.a.cherry@gmail.com> | 2012-05-29 21:38:57 +0400 |
---|---|---|
committer | Colin Cherry <colin.a.cherry@gmail.com> | 2012-05-29 21:38:57 +0400 |
commit | fd577d7a65cab923b9102d61873a032654d573a1 (patch) | |
tree | 24dddd8e7a412f29f2f55e8ecad0b6055f8530c0 /mert/BleuScorer.h | |
parent | 6d1165654caf8edc995a41a4c6c9666e65ebce96 (diff) |
Batch k-best MIRA is written and integrated into mert-moses.pl
Regression tests all check out, and kbmira seems to work fine
on a Hansard French->English task.
HypPackEnumerator class may be of interest to pro.cpp and future
optimizers, as it abstracts a lot of the boilerplate involved in
enumerating multiple k-best lists.
MiraWeightVector is not really mira-specific - just a weight vector
that enables efficient averaging. Could be useful to a perceptron
as well. Same goes for MiraFeatureVector.
Interaction with sparse features is written, but untested.
Diffstat (limited to 'mert/BleuScorer.h')
-rw-r--r-- | mert/BleuScorer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mert/BleuScorer.h b/mert/BleuScorer.h index 1f568f744..8f1384f5a 100644 --- a/mert/BleuScorer.h +++ b/mert/BleuScorer.h @@ -70,4 +70,14 @@ private: */ float sentenceLevelBleuPlusOne(const std::vector<float>& stats); +/** Computes sentence-level BLEU score given a background corpus. + * This function is used in batch MIRA. + */ +float sentenceLevelBackgroundBleu(const std::vector<float>& sent, const std::vector<float>& bg); + +/** + * Computes plain old BLEU from a vector of stats + */ +float unsmoothedBleu(const std::vector<float>& stats); + #endif // MERT_BLEU_SCORER_H_ |