class_docstr: Defines a wrapper class of Error Analysis for text scenario.
class_docstr_tok: ["Defines","a","wrapper","class","of","Error","Analysis","for","text","scenario","."]
docstr: Creates a wrapped predictor that uses index to retrieve text data.
  
  :param model: The model to analyze errors on.
      A model that implements sklearn.predict or sklearn.predict_proba
      or function that accepts a 2d ndarray.
  :type model: object
  :param dataset: The dataset including the label column.
  :type dataset: pandas.DataFrame
  :param target_column: The name of the label column or list of columns.
      This is a list of columns for multilabel models.
  :type target_column: str or list[str]
  :param text_column: The name of the text column or list of columns.
      This is a list of columns for question answering models.
  :type text_column: str or list[str]
  :param is_multilabel: Whether the model is multilabel.
  :type is_multilabel: bool
  :param task_type: The task to run.
  :type task_type: str
  :param classes: Class names as a list of strings.
      The order of the class names should match that of the model
      output.
  :type classes: list
  :return: A wrapped predictor that uses index to retrieve text data.
  :rtype: WrappedIndexPredictorModel
docstr_tok: ["Creates","a","wrapped","predictor","that","uses","index","to","retrieve","text","data",".",":","param","model",":","The","model","to","analyze","errors","on",".","A","model","that","implements","sklearn.predict","or","sklearn.predict_proba","or","function","that","accepts","a","2d","ndarray",".",":","type","model",":","object",":","param","dataset",":","The","dataset","including","the","label","column",".",":","type","dataset",":","pandas.DataFrame",":","param","target_column",":","The","name","of","the","label","column","or","list","of","columns",".","This","is","a","list","of","columns","for","multilabel","models",".",":","type","target_column",":","str","or","list","[","str","]",":","param","text_column",":","The","name","of","the","text","column","or","list","of","columns",".","This","is","a","list","of","columns","for","question","answering","models",".",":","type","text_column",":","str","or","list","[","str","]",":","param","is_multilabel",":","Whether","the","model","is","multilabel",".",":","type","is_multilabel",":","bool",":","param","task_type",":","The","task","to","run",".",":","type","task_type",":","str",":","param","classes",":","Class","names","as","a","list","of","strings",".","The","order","of","the","class","names","should","match","that","of","the","model","output",".",":","type","classes",":","list",":","return",":","A","wrapped","predictor","that","uses","index","to","retrieve","text","data",".",":","rtype",":","WrappedIndexPredictorModel"]
code: def _create_index_predictor(
      model,
      dataset,
      target_column,
      text_column,
      is_multilabel,
      task_type,
      classes=None,
  ):
      """Creates a wrapped predictor that uses index to retrieve text data.
  
      :param model: The model to analyze errors on.
          A model that implements sklearn.predict or sklearn.predict_proba
          or function that accepts a 2d ndarray.
      :type model: object
      :param dataset: The dataset including the label column.
      :type dataset: pandas.DataFrame
      :param target_column: The name of the label column or list of columns.
          This is a list of columns for multilabel models.
      :type target_column: str or list[str]
      :param text_column: The name of the text column or list of columns.
          This is a list of columns for question answering models.
      :type text_column: str or list[str]
      :param is_multilabel: Whether the model is multilabel.
      :type is_multilabel: bool
      :param task_type: The task to run.
      :type task_type: str
      :param classes: Class names as a list of strings.
          The order of the class names should match that of the model
          output.
      :type classes: list
      :return: A wrapped predictor that uses index to retrieve text data.
      :rtype: WrappedIndexPredictorModel
      """
      dataset = dataset.drop(columns=[target_column])
      dataset = get_text_columns(dataset, text_column)
      index_predictor = WrappedIndexPredictorModel(
          model, dataset, is_multilabel, task_type, classes
      )
      return index_predictor
  
imports: import json
  import numbers
  from typing import Any, List, Optional, Union
  import jsonschema
  import numpy
  import pandas
  from ml_wrappers import wrap_model
  from erroranalysis._internal.error_analyzer import ModelAnalyzer
  from erroranalysis._internal.error_report import as_error_report
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
  from responsibleai.exceptions import UserErrorException
  from responsibleai.managers.error_analysis_manager import ErrorAnalysisManager
  from responsibleai.managers.error_analysis_manager import as_error_config
  from responsibleai_text.common.constants import ModelTask
  from responsibleai_text.utils.feature_extractors import get_text_columns
label_desc: Use image node_id 2 for calling the ErrorAnalysisManager obj's underlying member method code with example usage: obj._create_index_predictor(model, dataset, target_column, text_column, is_multilabel, task_type, classes) and returns: index_predictor