class_docstr: TextFeature is used to visualize text (e.g. sentences) in Insights.
  It expects the visualization transform to convert the input data (e.g. index to
  string) to the raw text.
class_docstr_tok: ["TextFeature","is","used","to","visualize","text","(","e.g",".","sentences",")","in","Insights",".","It","expects","the","visualization","transform","to","convert","the","input","data","(","e.g",".","index","to","string",")","to","the","raw","text","."]
docstr: Args:
      name (str): The label of the specific feature. For example, an
                  ImageFeature's name can be "Photo".
      baseline_transforms (list, Callable, optional): Optional list of
                  callables (e.g. functions) to be called on the input tensor
                  to construct multiple baselines. Currently only one baseline
                  is supported. See
                  :py:class:`.IntegratedGradients` for more
                  information about baselines.
                  For text features, a common baseline is a tensor of indices
                  corresponding to PAD with the same size as the input
                  tensor. See :py:class:`.TokenReferenceBase` for more
                  information.
      input_transforms (list, Callable, optional): A list of transforms
                  or transform to be applied to the input. For text, a common
                  transform is to convert the tokenized input tensor into an
                  interpretable embedding. See
                  :py:class:`.InterpretableEmbeddingBase`
                  and
                  :py:func:`~.configure_interpretable_embedding_layer`
                  for more information.
      visualization_transform (Callable, optional): Optional callable (e.g.
                  function) applied as a postprocessing step of the original
                  input data (before ``input_transforms``) to convert it to a
                  suitable format for visualization. For text features,
                  a common function is to convert the token indices to their
                  corresponding (sub)words.
docstr_tok: ["Args",":","name","(","str",")",":","The","label","of","the","specific","feature",".","For","example",",","an","ImageFeature","'s","name","can","be","``","Photo","''",".","baseline_transforms","(","list",",","Callable",",","optional",")",":","Optional","list","of","callables","(","e.g",".","functions",")","to","be","called","on","the","input","tensor","to","construct","multiple","baselines",".","Currently","only","one","baseline","is","supported",".","See",":","py",":","class",":","`",".IntegratedGradients","`","for","more","information","about","baselines",".","For","text","features",",","a","common","baseline","is","a","tensor","of","indices","corresponding","to","PAD","with","the","same","size","as","the","input","tensor",".","See",":","py",":","class",":","`",".TokenReferenceBase","`","for","more","information",".","input_transforms","(","list",",","Callable",",","optional",")",":","A","list","of","transforms","or","transform","to","be","applied","to","the","input",".","For","text",",","a","common","transform","is","to","convert","the","tokenized","input","tensor","into","an","interpretable","embedding",".","See",":","py",":","class",":","`",".InterpretableEmbeddingBase","`","and",":","py",":","func",":","`","~.configure_interpretable_embedding_layer","`","for","more","information",".","visualization_transform","(","Callable",",","optional",")",":","Optional","callable","(","e.g",".","function",")","applied","as","a","postprocessing","step","of","the","original","input","data","(","before","``","input_transforms","``",")","to","convert","it","to","a","suitable","format","for","visualization",".","For","text","features",",","a","common","function","is","to","convert","the","token","indices","to","their","corresponding","(","sub",")","words","."]
code: def __init__(
      self,
      name: str,
      baseline_transforms: Union[Callable, List[Callable]],
      input_transforms: Union[Callable, List[Callable]],
      visualization_transform: Callable,
  ) -> None:
      r"""
      Args:
          name (str): The label of the specific feature. For example, an
                      ImageFeature's name can be "Photo".
          baseline_transforms (list, Callable, optional): Optional list of
                      callables (e.g. functions) to be called on the input tensor
                      to construct multiple baselines. Currently only one baseline
                      is supported. See
                      :py:class:`.IntegratedGradients` for more
                      information about baselines.
                      For text features, a common baseline is a tensor of indices
                      corresponding to PAD with the same size as the input
                      tensor. See :py:class:`.TokenReferenceBase` for more
                      information.
          input_transforms (list, Callable, optional): A list of transforms
                      or transform to be applied to the input. For text, a common
                      transform is to convert the tokenized input tensor into an
                      interpretable embedding. See
                      :py:class:`.InterpretableEmbeddingBase`
                      and
                      :py:func:`~.configure_interpretable_embedding_layer`
                      for more information.
          visualization_transform (Callable, optional): Optional callable (e.g.
                      function) applied as a postprocessing step of the original
                      input data (before ``input_transforms``) to convert it to a
                      suitable format for visualization. For text features,
                      a common function is to convert the token indices to their
                      corresponding (sub)words.
      """
      super().__init__(
          name,
          baseline_transforms=baseline_transforms,
          input_transforms=input_transforms,
          visualization_transform=visualization_transform,
      )
  
imports: import base64
  import warnings
  from collections import namedtuple
  from io import BytesIO
  from typing import Callable, List, Optional, Union
  from captum._utils.common import safe_div
  from captum.attr._utils import visualization
  from captum.insights.attr_vis._utils.transforms import format_transforms
label_desc: Use image node_id 1 to create a new TextFeature object from inherited base classes: BaseFeature with example: obj = TextFeature(name, baseline_transforms, input_transforms, visualization_transform)