neuralmonkey
neuralmonkey copied to clipboard
ChrF fails on division by zero
In case len(tokens) == 0
(i.e. the input sentence is empty) ChrF crashes with ZeroDivisionError
on line 89:
https://github.com/ufal/neuralmonkey/blob/master/neuralmonkey/evaluators/chrf.py#L89
File "/lnet/spec/work/people/kasner/neuralmonkey-ctc-decoder/neuralmonkey/bin/neuralmonkey/evaluators/chrf.py", line 89, in chr_p
return precision / float(self.max_ord)
ZeroDivisionError: float division by zero