class_docstr: TextClassifier handler class. This handler takes a text (string) and
  as input and returns the classification text based on the model vocabulary.
  Because the predefined TextHandler in ts/torch_handler defines unnecessary
  steps like loading a vocabulary file for the tokenizer, we define our handler
  starting from BaseHandler.
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",".","Because","the","predefined","TextHandler","in","ts\/torch_handler","defines","unnecessary","steps","like","loading","a","vocabulary","file","for","the","tokenizer",",","we","define","our","handler","starting","from","BaseHandler","."]
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/examples/text_classification_with_scriptable_tokenizer/handler.py
imports: import logging
  from abc import ABC
  import torch
  import torch.nn.functional
  import torchtext
  from ts.torch_handler.base_handler import BaseHandler
  from ts.utils.util import CLEANUP_REGEX, map_class_to_label
label_desc: Use image node_id 3 for calling the CustomTextClassifier obj's underlying member method code with example usage: obj.postprocess(data) and returns: map_class_to_label