code: def label_encoder(self, label):
      batch = len(label)
  
      length = [len(i) for i in label]
      length_tensor = paddle.to_tensor(length, dtype="int64")
  
      max_length = max(length)
      input_tensor = np.zeros((batch, max_length))
      for i in range(batch):
          for j in range(length[i] - 1):
              input_tensor[i][j + 1] = self.english_dict[label[i][j]]
  
      text_gt = []
      for i in label:
          for j in i:
              text_gt.append(self.english_dict[j])
      text_gt = paddle.to_tensor(text_gt, dtype="int64")
  
      input_tensor = paddle.to_tensor(input_tensor, dtype="int64")
      return length_tensor, input_tensor, text_gt
  
imports: import math
  import warnings
  import numpy
  import paddle
  from paddle import nn
  import string
  from .tps_spatial_transformer import TPSSpatialTransformer
  from .stn import STN
  from .tsrn import GruBlock, mish, UpsampleBLock
  from ppocr.modeling.heads.sr_rensnet_transformer import Transformer, LayerNorm, PositionwiseFeedForward, MultiHeadedAttention
label_desc: Use image node_id 2 for calling the TBSRN obj's underlying member method code with example usage: obj.label_encoder(label) and returns: length_tensor,  input_tensor,  text_gt