CTC token update fix

This commit is contained in:
Baek JeongHun 2019-04-18 02:05:41 +00:00
parent f48694a2af
commit 017df17d56
1 changed files with 2 additions and 2 deletions

View File

@ -6,12 +6,12 @@ class CTCLabelConverter(object):
def __init__(self, character):
# character (str): set of the possible characters.
list_token = ['[BLANK]'] # '[BLANK] ' for blank token (index 0)
list_token = ['[blank]'] # dummy '[blank]' token for CTCLoss (index 0)
list_character = list(character)
self.character = list_token + list_character
self.dict = {}
for i, char in enumerate(self.character):
for i, char in enumerate(list_character):
# NOTE: 0 is reserved for 'blank' token required by CTCLoss
self.dict[char] = i + 1