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: Gets the token names for top-k token ids for Causal/Masked LM.
  
  Parameters
  ----------
  X: np.ndarray
      Input(Text) for an explanation row.
  
  Returns
  -------
  list
      A list of output tokens.
docstr_tok: ["Gets","the","token","names","for","top-k","token","ids","for","Causal\/Masked","LM",".","Parameters","--","--","--","--","--","X",":","np.ndarray","Input","(","Text",")","for","an","explanation","row",".","Returns","--","--","--","-","list","A","list","of","output","tokens","."]
code: def get_output_names_and_update_topk_token_ids(self, X):
      """Gets the token names for top-k token ids for Causal/Masked LM.
  
      Parameters
      ----------
      X: np.ndarray
          Input(Text) for an explanation row.
  
      Returns
      -------
      list
          A list of output tokens.
      """
  
      # see if the user gave a custom token generator
      if self._custom_generate_topk_token_ids is not None:
          return self._custom_generate_topk_token_ids(X)
  
      # otherwise we pick the top k tokens from the model
      self.topk_token_ids = self.generate_topk_token_ids(X)
      output_names = [
          self.tokenizer.decode([x]) for x in self.topk_token_ids
      ]
      return output_names
  
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 4 for calling the TopKLM obj's underlying member method code with example usage: obj.get_output_names_and_update_topk_token_ids(X) and returns: output_names, self