class_docstr: Base class for all text based default handler.
  Contains various text based utility methods
class_docstr_tok: ["Base","class","for","all","text","based","default","handler",".","Contains","various","text","based","utility","methods"]
docstr: Loads the model and Initializes the necessary artifacts
docstr_tok: ["Loads","the","model","and","Initializes","the","necessary","artifacts"]
code: def initialize(self, context):
      """
      Loads the model and Initializes the necessary artifacts
      """
      super().initialize(context)
      self.initialized = False
      source_vocab = (
          self.manifest["model"]["sourceVocab"]
          if "sourceVocab" in self.manifest["model"]
          else None
      )
      if source_vocab:
          # Backward compatibility
          self.source_vocab = torch.load(source_vocab)
      else:
          self.source_vocab = torch.load(
              self.get_source_vocab_path(context)
          )
      # Captum initialization
      self.lig = LayerIntegratedGradients(
          self.model, self.model.embedding
      )
      self.initialized = True
  
imports: import logging
  import os
  import re
  import string
  import unicodedata
  from abc import ABC
  import torch
  import torch.nn.functional
  from captum.attr import LayerIntegratedGradients
  from torchtext.data.utils import get_tokenizer
  from ..utils.util import CLEANUP_REGEX
  from .base_handler import BaseHandler
  from .contractions import CONTRACTION_MAP
label_desc: Use image node_id 2 for calling the TextHandler obj's underlying member method code with example usage: obj.initialize(context) without return types