diff --git a/ppocr/metrics/rec_metric.py b/ppocr/metrics/rec_metric.py index b3aa9f38f8378eee7104d7e3696b86bede0de903..66c084d771dece0e2974bc72a177b53f564a8f2e 100644 --- a/ppocr/metrics/rec_metric.py +++ b/ppocr/metrics/rec_metric.py @@ -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