class_docstr: Convert between text-label and text-index 
class_docstr_tok: ["Convert","between","text-label","and","text-index"]
code: def __init__(self, config):
      self.character_type = config["character_type"]
      self.loss_type = config["loss_type"]
      if self.character_type == "en":
          self.character_str = "0123456789abcdefghijklmnopqrstuvwxyz"
          dict_character = list(self.character_str)
      elif self.character_type == "ch":
          character_dict_path = config["character_dict_path"]
          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 += line
          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
      assert (
          self.character_str is not None
      ), "Nonsupport type of the character: {}".format(
          self.character_str
      )
      self.beg_str = "sos"
      self.end_str = "eos"
      if self.loss_type == "attention":
          dict_character = [self.beg_str, self.end_str] + dict_character
      self.dict = {}
      for i, char in enumerate(dict_character):
          self.dict[char] = i
      self.character = dict_character
  
imports: import cv2
  import copy
  import numpy
  import math
  import re
  import sys
  import argparse
  import string
  from copy import deepcopy
label_desc: Use image node_id 1 to create a new CharacterOps object from inherited base classes: object with example: obj = CharacterOps(config)