class_docstr: Convert between text-label and text-index 
class_docstr_tok: ["Convert","between","text-label","and","text-index"]
docstr: convert text-index into text-label. 
docstr_tok: ["convert","text-index","into","text-label","."]
code: def decode(self, text_index, is_remove_duplicate=False):
      """convert text-index into text-label."""
      char_list = []
      char_num = self.get_char_num()
  
      if self.loss_type == "attention":
          beg_idx = self.get_beg_end_flag_idx("beg")
          end_idx = self.get_beg_end_flag_idx("end")
          ignored_tokens = [beg_idx, end_idx]
      else:
          ignored_tokens = [char_num]
  
      for idx in range(len(text_index)):
          if text_index[idx] in ignored_tokens:
              continue
          if is_remove_duplicate:
              if idx > 0 and text_index[idx - 1] == text_index[idx]:
                  continue
          char_list.append(self.character[text_index[idx]])
      text = "".join(char_list)
      return text
  
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 3 for calling the CharacterOps obj's underlying member method code with example usage: obj.decode(text_index, is_remove_duplicate) and returns: text