Skip to content

Commit

Permalink
fix space eval
Browse files Browse the repository at this point in the history
  • Loading branch information
littletomatodonkey committed Jan 7, 2021
1 parent e7bf6c8 commit f5008a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ppocr/metrics/rec_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def __call__(self, pred_label, *args, **kwargs):
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:
Expand Down

0 comments on commit f5008a0

Please sign in to comment.