Commit 66d4211e authored by Sebastian Nickels's avatar Sebastian Nickels

Updated tests

parent 3ab53efe
Pipeline #235164 passed with stages
in 4 minutes and 25 seconds
......@@ -143,7 +143,12 @@ class BLEU(mx.metric.EvalMetric):
if self._size_hyp >= self._size_ref:
return 1
else:
return math.exp(1 - (self._size_ref / self._size_hyp))
if self._size_hyp > 0:
size_hyp = self._size_hyp
else:
size_hyp = 1
return math.exp(1 - (self._size_ref / size_hyp))
@staticmethod
def _get_ngrams(sentence, n):
......
......@@ -143,7 +143,12 @@ class BLEU(mx.metric.EvalMetric):
if self._size_hyp >= self._size_ref:
return 1
else:
return math.exp(1 - (self._size_ref / self._size_hyp))
if self._size_hyp > 0:
size_hyp = self._size_hyp
else:
size_hyp = 1
return math.exp(1 - (self._size_ref / size_hyp))
@staticmethod
def _get_ngrams(sentence, n):
......
......@@ -143,7 +143,12 @@ class BLEU(mx.metric.EvalMetric):
if self._size_hyp >= self._size_ref:
return 1
else:
return math.exp(1 - (self._size_ref / self._size_hyp))
if self._size_hyp > 0:
size_hyp = self._size_hyp
else:
size_hyp = 1
return math.exp(1 - (self._size_ref / size_hyp))
@staticmethod
def _get_ngrams(sentence, n):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment