Commit Graph

13 Commits

Author SHA1 Message Date
Rico Sennrich
6810b225cc calculateScore with float (for smoothing support) 2014-09-22 10:49:20 +01:00
Hieu Hoang
6249432407 beautify 2013-05-29 18:16:15 +01:00
Barry Haddow
9ca364fb22 Implement brevity penalty smoothing for PRO
As in Nakov et al (Coling 2012)
2013-02-18 11:11:20 +00:00
Hieu Hoang
121e258e84 namespace all classes in mert directory 2012-06-30 21:39:10 +01:00
Colin Cherry
fd577d7a65 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.
2012-05-29 13:38:57 -04:00
Tetsuo Kiso
9c9d88a78a Avoid "using namespace std" in headers. 2012-05-10 07:51:05 +09:00
Tetsuo Kiso
91a6725081 Add a test case for setting up BLEU's reference length.
To make sure the type of effective reference length is
set to the specified arguments.
2012-04-22 20:11:05 +09:00
Tetsuo Kiso
0e9b5fd9d0 Add const to return values of overloaded operators.
* This commit prevents developers from doing mistakes like:

  Point p1, p2, p4;
  if (p1 + p2 = p4) { // Bang! We actually wanted to compare
                      // the result of two points: (p1 + p2 == p4).
    // do something.
  }

See, e.g., http://www.gotw.ca/gotw/006.htm for details.

* Add more test cases according to this change.
* Move a helper function to compare floating point numbers
  to Util.h.
2012-04-12 09:16:27 +09:00
Tetsuo Kiso
d034eeb703 Add test cases for BLEU and sentence-level BLEU+1.
- Move a definition of sentenceLevelBleuPlusOne() from pro.cpp
  to BleuScorer.cpp.
- Add check for the length of an input vector.
2012-04-07 01:02:32 +09:00
Tetsuo Kiso
a6cec240c0 Fix typo. 2012-04-04 22:36:22 +09:00
Tetsuo Kiso
eaa0ab486a Add a test case for BLEU's clipped counts.
- Make BleuScorer::setReferenceFiles() more testable by
  adding OpenReference() and OpenReferenceStream().
2012-04-04 22:33:30 +09:00
Tetsuo Kiso
8e79cd5692 Use assertions in the test case.
It gets easier to detect the point of failure in the test.
2012-03-20 16:57:57 +09:00
Tetsuo Kiso
2fdb47fe67 Add an unit test for BleuScorer.
The test contains only ngram counting. More tests for calculating
BLEU score are reuiqred.
2012-03-20 05:52:35 +09:00