class_docstr: Defines the mixin for text explanations.
class_docstr_tok: ["Defines","the","mixin","for","text","explanations","."]
docstr: Create the text explanation.
  :param predicted_label: The label predicted by the classifier
  :type predicted_label: string
  :param true_label: The ground truth label for the sentence
  :type true_label: string
docstr_tok: ["Create","the","text","explanation",".",":","param","predicted_label",":","The","label","predicted","by","the","classifier",":","type","predicted_label",":","string",":","param","true_label",":","The","ground","truth","label","for","the","sentence",":","type","true_label",":","string"]
code: def __init__(self, predicted_label=None, true_label=None, **kwargs):
      """Create the text explanation.
      :param predicted_label: The label predicted by the classifier
      :type predicted_label: string
      :param true_label: The ground truth label for the sentence
      :type true_label: string
      """
      super(TextExplanation, self).__init__(**kwargs)
      order = _order_imp(np.abs(self.local_importance_values))
      self._local_importance_rank = _sort_values(self._features, order)
      self._predicted_label = predicted_label
      self._true_label = true_label
      self._logger.debug("Initializing TextExplanation")
      if len(order.shape) == 3:
          i = np.arange(order.shape[0])[:, np.newaxis]
          j = np.arange(order.shape[1])[:, np.newaxis]
          self._ordered_local_importance_values = np.array(
              self.local_importance_values
          )[i, j, order]
      else:
          self._ordered_local_importance_values = (
              self.local_importance_values
          )
  
file_path: interpret-text/python/interpret_text/experimental/explanation.py
imports: import numpy
  import uuid
  from interpret_community.common.explanation_utils import _sort_values, _order_imp
  from interpret_community.common.constants import Dynamic, ExplanationParams, ExplainParams
  from interpret_community.explanation.explanation import LocalExplanation, ExpectedValuesMixin, ClassesMixin
label_desc: Use image node_id 1 to create a new TextExplanation object from inherited base classes: LocalExplanation with example: obj = TextExplanation(predicted_label, true_label)