summaryrefslogtreecommitdiff
path: root/mteval/ns_wer.cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-04-12 10:59:34 +0200
committerPatrick Simianer <p@simianer.de>2016-04-12 10:59:34 +0200
commit833d84354b9c57068723e9d7a2e87a409eddd329 (patch)
tree8e9d55934ef666f1acd0bcb1317943ff80598e97 /mteval/ns_wer.cc
parentd0613843f2ce5628aa6728f3672d59877ef85833 (diff)
parentee4f3c5581e43510d98de1274c6c1c2984c87faf (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mteval/ns_wer.cc')
-rw-r--r--mteval/ns_wer.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/mteval/ns_wer.cc b/mteval/ns_wer.cc
index f9b2bbbb..057ad49e 100644
--- a/mteval/ns_wer.cc
+++ b/mteval/ns_wer.cc
@@ -18,10 +18,10 @@ void WERMetric::ComputeSufficientStatistics(const std::vector<WordID>& hyp,
const std::vector<std::vector<WordID> >& refs,
SufficientStats* out) const {
out->fields.resize(kNUMFIELDS);
- float best_score = hyp.size();
+ float best_score = 0;
for (size_t i = 0; i < refs.size(); ++i) {
float score = cdec::LevenshteinDistance(hyp, refs[i]);
- if (score < best_score) {
+ if (score < best_score || i == 0) {
out->fields[kEDITDISTANCE] = score;
out->fields[kCHARCOUNT] = refs[i].size();
best_score = score;