未验证 提交 d36a929b 编写于 作者: M MissPenguin 提交者: GitHub

Merge pull request #1913 from WenmuZhou/dygraph_rc

fix divide zero error
......@@ -29,7 +29,7 @@ class RecMetric(object):
pred = pred.replace(" ", "")
target = target.replace(" ", "")
norm_edit_dis += Levenshtein.distance(pred, target) / max(
len(pred), len(target))
len(pred), len(target), 1)
if pred == target:
correct_num += 1
all_num += 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册