class_docstr: Defines the ExplainerManager for explaining a text-based model.
class_docstr_tok: ["Defines","the","ExplainerManager","for","explaining","a","text-based","model","."]
code: def _get_interpret(self, explanation):
      interpretation = ModelExplanationData()
  
      try:
          importances = FeatureImportance()
          (
              features,
              scores,
              intercept,
          ) = self._compute_global_importances(explanation)
          importances.featureNames = features
          importances.scores = scores
          importances.intercept = intercept
          text_feature_importances = (
              self._compute_text_feature_importances(explanation)
          )
          precomputedExplanations = PrecomputedExplanations()
          precomputedExplanations.globalFeatureImportance = importances
          precomputedExplanations.textFeatureImportance = (
              text_feature_importances
          )
          interpretation.precomputedExplanations = (
              precomputedExplanations
          )
      except Exception as ex:
          raise ValueError("Unsupported explanation type") from ex
      return interpretation
  
imports: import json
  import pickle
  import warnings
  from pathlib import Path
  from typing import Any, List, Optional
  import numpy
  import pandas
  import shap
  from raiutils.data_processing import convert_to_list
  from responsibleai._interfaces import FeatureImportance, ModelExplanationData, PrecomputedExplanations, TextFeatureImportance
  from responsibleai._internal.constants import ExplainerManagerKeys
  from responsibleai._internal.constants import ListProperties, ManagerNames, Metadata
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
  from responsibleai.exceptions import UserConfigValidationException
  from responsibleai.managers.base_manager import BaseManager
  from responsibleai_text.common.constants import ModelTask, QuestionAnsweringFields, Tokens
  from responsibleai_text.utils.question_answering import QAPredictor
label_desc: Use image node_id 9 for calling the ExplainerManager obj's underlying member method code with example usage: obj._get_interpret(explanation) and returns: interpretation