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, text_prob=None, is_remove_duplicate=False
  ):
      """convert text-index into text-label."""
      result_list = []
      ignored_tokens = self.get_ignored_tokens()
      batch_size = len(text_index)
      for batch_idx in range(batch_size):
          selection = np.ones(len(text_index[batch_idx]), dtype=bool)
          if is_remove_duplicate:
              selection[1:] = (
                  text_index[batch_idx][1:]
                  != text_index[batch_idx][:-1]
              )
          for ignored_token in ignored_tokens:
              selection &= text_index[batch_idx] != ignored_token
  
          char_list = [
              self.character[text_id]
              for text_id in text_index[batch_idx][selection]
          ]
          if text_prob is not None:
              conf_list = text_prob[batch_idx][selection]
          else:
              conf_list = [1] * len(selection)
          if len(conf_list) == 0:
              conf_list = [0]
  
          text = "".join(char_list)
          result_list.append((text, np.mean(conf_list).tolist()))
      return result_list
  
imports: import numpy
  import paddle
  from paddle.nn import functional
  import re
  from shapely.geometry import Polygon
  import cv2
  import copy
label_desc: Use image node_id 3 for calling the BaseRecLabelDecode obj's underlying member method code with example usage: obj.decode(text_index, text_prob, is_remove_duplicate) and returns: result_list