"docs/source/en/api/schedulers/deis.md" did not exist on "5a38033de4824c8d5d9b2856776df45592a8e825"
Commit a88ce7a5 authored by WenmuZhou's avatar WenmuZhou
Browse files

修正对label decode时重复字符会消失的bug

parent ca9ea622
......@@ -70,6 +70,7 @@ class BaseRecLabelDecode(object):
if text_index[batch_idx][idx] in ignored_tokens:
continue
if is_remove_duplicate:
# only for predict
if idx > 0 and text_index[batch_idx][idx - 1] == text_index[
batch_idx][idx]:
continue
......@@ -107,7 +108,7 @@ class CTCLabelDecode(BaseRecLabelDecode):
text = self.decode(preds_idx, preds_prob)
if label is None:
return text
label = self.decode(label)
label = self.decode(label, is_remove_duplicate=False)
return text, label
def add_special_char(self, dict_character):
......
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