class_docstr: Convert between text-label and text-index
  Args:
      config: config from yaml file
class_docstr_tok: ["Convert","between","text-label","and","text-index","Args",":","config",":","config","from","yaml","file"]
code: def __init__(self, config):
      self.character_type = config["character_type"]
      self.max_text_len = config["max_text_length"]
      if self.character_type == "en":
          self.character_str = "0123456789abcdefghijklmnopqrstuvwxyz"
          dict_character = list(self.character_str)
      # use the custom dictionary
      elif self.character_type == "ch":
          character_dict_path = config["character_dict_path"]
          add_space = False
          if "use_space_char" in config:
              add_space = config["use_space_char"]
          self.character_str = []
          with open(character_dict_path, "rb") as fin:
              lines = fin.readlines()
              for line in lines:
                  line = line.decode("utf-8").strip("\n").strip("\r\n")
                  self.character_str.append(line)
          if add_space:
              self.character_str.append(" ")
          dict_character = list(self.character_str)
      elif self.character_type == "en_sensitive":
          # same with ASTER setting (use 94 char).
          self.character_str = string.printable[:-6]
          dict_character = list(self.character_str)
      else:
          self.character_str = None
      self.beg_str = "sos"
      self.end_str = "eos"
  
      dict_character = self.add_special_char(dict_character)
      self.dict = {}
      for i, char in enumerate(dict_character):
          self.dict[char] = i
      self.character = dict_character
  
file_path: PaddleHub/modules/image/text_recognition/ch_pp-ocrv3/character.py
imports: import string
  import numpy
label_desc: Use image node_id 1 to create a new CharacterOps object from inherited base classes: object with example: obj = CharacterOps(config)