class_docstr: This wraps a transformers pipeline object for easy explanations.
  
  By default transformers pipeline object output lists of dictionaries, not standard
  tensors as expected by SHAP. This class wraps pipelines to make them output nice
  tensor formats.
docstr: Build a new model by wrapping the given pipeline object.
          
docstr_tok: ["Build","a","new","model","by","wrapping","the","given","pipeline","object","."]
code: def __init__(self, pipeline, rescale_to_logits=False):
      """Build a new model by wrapping the given pipeline object."""
      super().__init__(pipeline)  # the pipeline becomes our inner_model
      self.rescale_to_logits = rescale_to_logits
  
      # self.tokenizer = self.inner_model.model.tokenizer
      self.label2id = self.inner_model.model.config.label2id
      self.id2label = self.inner_model.model.config.id2label
      self.output_shape = (max(self.label2id.values()) + 1,)
      if len(self.output_shape) == 1:
          self.output_names = [
              self.id2label.get(i, "Unknown")
              for i in range(self.output_shape[0])
          ]
  
imports: import numpy
  import scipy.special
  from ._model import Model
label_desc: Use image node_id 1 to create a new TransformersPipeline object from inherited base classes: Model with example: obj = TransformersPipeline(pipeline, rescale_to_logits)