class_docstr: TextClassifier handler class. This handler takes a text (string) and
  as input and returns the classification text based on the model vocabulary.
class_docstr_tok: ["TextClassifier","handler","class",".","This","handler","takes","a","text","(","string",")","and","as","input","and","returns","the","classification","text","based","on","the","model","vocabulary","."]
docstr: The post process function converts the prediction response into a
     Torchserve compatible format
  
  Args:
      data (Torch Tensor): The data parameter comes from the prediction output
      output_explain (None): Defaults to None.
  
  Returns:
      (list): Returns the response containing the predictions and explanations
              (if the Endpoint is hit).It takes the form of a list of dictionary.
docstr_tok: ["The","post","process","function","converts","the","prediction","response","into","a","Torchserve","compatible","format","Args",":","data","(","Torch","Tensor",")",":","The","data","parameter","comes","from","the","prediction","output","output_explain","(","None",")",":","Defaults","to","None",".","Returns",":","(","list",")",":","Returns","the","response","containing","the","predictions","and","explanations","(","if","the","Endpoint","is","hit",")",".It","takes","the","form","of","a","list","of","dictionary","."]
code: def postprocess(self, data):
      """
      The post process function converts the prediction response into a
         Torchserve compatible format
  
      Args:
          data (Torch Tensor): The data parameter comes from the prediction output
          output_explain (None): Defaults to None.
  
      Returns:
          (list): Returns the response containing the predictions and explanations
                  (if the Endpoint is hit).It takes the form of a list of dictionary.
      """
      data = F.softmax(data)
      data = data.tolist()
      return map_class_to_label(data, self.mapping)
  
file_path: serve/ts/torch_handler/text_classifier.py
imports: import logging
  import torch
  import torch.nn.functional
  from captum.attr import TokenReferenceBase
  from torchtext.data.utils import ngrams_iterator
  from ..utils.util import map_class_to_label
  from .text_handler import TextHandler
label_desc: Use image node_id 3 for calling the TextClassifier obj's underlying member method code with example usage: obj.postprocess(data) and returns: map_class_to_label