Unverified Commit a27bd4d5 authored by dyning's avatar dyning Committed by GitHub
Browse files

Merge pull request #1678 from littletomatodonkey/dyg/fix_space_eval

fix space eval
parents eb1d69a5 f5008a0a
......@@ -26,6 +26,8 @@ class RecMetric(object):
all_num = 0
norm_edit_dis = 0.0
for (pred, pred_conf), (target, _) in zip(preds, labels):
pred = pred.replace(" ", "")
target = target.replace(" ", "")
norm_edit_dis += Levenshtein.distance(pred, target) / max(
len(pred), len(target))
if pred == target:
......
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