class_docstr: Convert between text-label and text-index 
class_docstr_tok: ["Convert","between","text-label","and","text-index"]
docstr: convert text-label into text-index.
  input:
      text: text labels of each image. [batch_size]
  
  output:
      text: concatenated text index for CTCLoss.
              [sum(text_lengths)] = [text_index_0 + text_index_1 + ... + text_index_(n - 1)]
      length: length of each text. [batch_size]
docstr_tok: ["convert","text-label","into","text-index",".","input",":","text",":","text","labels","of","each","image",".","[","batch_size","]","output",":","text",":","concatenated","text","index","for","CTCLoss",".","[","sum","(","text_lengths",")","]","=","[","text_index_0","+","text_index_1","+","...","+","text_index_","(","n","-","1",")","]","length",":","length","of","each","text",".","[","batch_size","]"]
code: def encode(self, text, batch_max_length=25):
      """convert text-label into text-index.
      input:
          text: text labels of each image. [batch_size]
  
      output:
          text: concatenated text index for CTCLoss.
                  [sum(text_lengths)] = [text_index_0 + text_index_1 + ... + text_index_(n - 1)]
          length: length of each text. [batch_size]
      """
      length = [len(s) for s in text]
      text = "".join(text)
      text = [self.dict[char] for char in text]
  
      return (torch.IntTensor(text), torch.IntTensor(length))
  
imports: import torch
  import pickle
  import numpy
label_desc: Use image node_id 2 for calling the CTCLabelConverter obj's underlying member method code with example usage: obj.encode(text, batch_max_length) and returns: torch,  torch