class_docstr: Generates scores (log odds) for the top-k tokens for Causal/Masked LM.
      
class_docstr_tok: ["Generates","scores","(","log","odds",")","for","the","top-k","tokens","for","Causal\/Masked","LM","."]
docstr: The function tokenizes source sentence.
  
  Parameters
  ----------
  X: numpy.ndarray
      X is a batch of text.
  
  Returns
  -------
  dict
      Dictionary of padded source sentence ids and attention mask as tensors("pt" or "tf" based on similarity_model_type).
docstr_tok: ["The","function","tokenizes","source","sentence",".","Parameters","--","--","--","--","--","X",":","numpy.ndarray","X","is","a","batch","of","text",".","Returns","--","--","--","-","dict","Dictionary","of","padded","source","sentence","ids","and","attention","mask","as","tensors","(","``","pt","''","or","``","tf","''","based","on","similarity_model_type",")","."]
code: def get_inputs(self, X, padding_side="right"):
      """The function tokenizes source sentence.
  
      Parameters
      ----------
      X: numpy.ndarray
          X is a batch of text.
  
      Returns
      -------
      dict
          Dictionary of padded source sentence ids and attention mask as tensors("pt" or "tf" based on similarity_model_type).
      """
      self.tokenizer.padding_side = padding_side
      inputs = self.tokenizer(
          X.tolist(), return_tensors=self.model_type, padding=True
      )
      # set tokenizer padding to default
      self.tokenizer.padding_side = "right"
      return inputs
  
file_path: shap/shap/models/_topk_lm.py
imports: import numpy
  import scipy.special
  from .._serializable import Deserializer, Serializer
  from ..utils import safe_isinstance
  from ..utils.transformers import MODELS_FOR_CAUSAL_LM, getattr_silent
  from ._model import Model
label_desc: Use image node_id 6 for calling the TopKLM obj's underlying member method code with example usage: obj.get_inputs(X, padding_side) and returns: inputs