class_docstr: ```
  predicts text classes
  ```
class_docstr_tok: ["``","`","predicts","text","classes","``","`"]
docstr: Highlights text to explain prediction
  Args:
      doc (str): text of documnet
      truncate_len(int): truncate document to this many words
      all_targets(bool):  If True, show visualization for
                          each target.
      n_samples(int): number of samples to generate and train on.
                      Larger values give better results, but will take more time.
                      Lower this value if explain is taking too long.
docstr_tok: ["Highlights","text","to","explain","prediction","Args",":","doc","(","str",")",":","text","of","documnet","truncate_len","(","int",")",":","truncate","document","to","this","many","words","all_targets","(","bool",")",":","If","True",",","show","visualization","for","each","target",".","n_samples","(","int",")",":","number","of","samples","to","generate","and","train","on",".","Larger","values","give","better","results",",","but","will","take","more","time",".","Lower","this","value","if","explain","is","taking","too","long","."]
code: def explain(
      self, doc, truncate_len=512, all_targets=False, n_samples=2500
  ):
      """
      Highlights text to explain prediction
      Args:
          doc (str): text of documnet
          truncate_len(int): truncate document to this many words
          all_targets(bool):  If True, show visualization for
                              each target.
          n_samples(int): number of samples to generate and train on.
                          Larger values give better results, but will take more time.
                          Lower this value if explain is taking too long.
      """
      is_array, is_pair = detect_text_format(doc)
      if is_pair:
          warnings.warn(
              "currently_unsupported: explain does not currently support sentence pair classification"
          )
          return
      if not self.c:
          warnings.warn(
              "currently_unsupported: explain does not support text regression"
          )
          return
      try:
          import eli5
          from eli5.lime import TextExplainer
      except:
          msg = (
              "ktrain requires a forked version of eli5 to support tf.keras. "
              + "Install with: pip install https://github.com/amaiya/eli5-tf/archive/refs/heads/master.zip"
          )
          warnings.warn(msg)
          return
  
      if not isinstance(doc, str):
          raise TypeError("text must of type str")
      prediction = [self.predict(doc)] if not all_targets else None
  
      if self.preproc.is_nospace_lang():
          doc = self.preproc.process_chinese([doc])
          doc = doc[0]
      doc = " ".join(doc.split()[:truncate_len])
      te = TextExplainer(random_state=42, n_samples=n_samples)
      _ = te.fit(doc, self.predict_proba)
      return te.show_prediction(
          target_names=self.preproc.get_classes(), targets=prediction
      )
  
file_path: ktrain/ktrain/text/predictor.py
imports: from ..None import utils
  from ..imports import *
  from ..predictor import Predictor
  from .preprocessor import TextPreprocessor, TransformersPreprocessor, detect_text_format
label_desc: Use image node_id 5 for calling the TextPredictor obj's underlying member method code with example usage: obj.explain(doc, truncate_len, all_targets, n_samples) and returns: te