未验证 提交 ba04894d 编写于 作者: u010070587's avatar u010070587 提交者: GitHub

Merge pull request #7344 from Topdu/dygraph

fix arabic postprocess bug
......@@ -24,7 +24,7 @@ class BaseRecLabelDecode(object):
def __init__(self, character_dict_path=None, use_space_char=False):
self.beg_str = "sos"
self.end_str = "eos"
self.reverse = False
self.character_str = []
if character_dict_path is None:
self.character_str = "0123456789abcdefghijklmnopqrstuvwxyz"
......@@ -38,6 +38,8 @@ class BaseRecLabelDecode(object):
if use_space_char:
self.character_str.append(" ")
dict_character = list(self.character_str)
if 'arabic' in character_dict_path:
self.reverse = True
dict_character = self.add_special_char(dict_character)
self.dict = {}
......@@ -45,11 +47,6 @@ class BaseRecLabelDecode(object):
self.dict[char] = i
self.character = dict_character
if 'arabic' in character_dict_path:
self.reverse = True
else:
self.reverse = False
def pred_reverse(self, pred):
pred_re = []
c_current = ''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册