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: Generates top-k token ids for Causal/Masked LM.
  
  Parameters
  ----------
  X: numpy.ndarray
      X is the original input sentence for an explanation row.
  
  Returns
  -------
  np.ndarray
      An array of top-k token ids.
docstr_tok: ["Generates","top-k","token","ids","for","Causal\/Masked","LM",".","Parameters","--","--","--","--","--","X",":","numpy.ndarray","X","is","the","original","input","sentence","for","an","explanation","row",".","Returns","--","--","--","-","np.ndarray","An","array","of","top-k","token","ids","."]
code: def generate_topk_token_ids(self, X):
      """Generates top-k token ids for Causal/Masked LM.
  
      Parameters
      ----------
      X: numpy.ndarray
          X is the original input sentence for an explanation row.
  
      Returns
      -------
      np.ndarray
          An array of top-k token ids.
      """
      logits = self.get_lm_logits(X)
      topk_tokens_ids = (-logits).argsort()[0, : self.k]
      return topk_tokens_ids
  
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 7 for calling the TopKLM obj's underlying member method code with example usage: obj.generate_topk_token_ids(X) and returns: topk_tokens_ids