class_docstr: Defines the top-level RAITextInsights API.
  
  Use RAITextInsights to assess text machine learning models in a
  single API.
class_docstr_tok: ["Defines","the","top-level","RAITextInsights","API",".","Use","RAITextInsights","to","assess","text","machine","learning","models","in","a","single","API","."]
docstr: Validate the inputs for the RAITextInsights constructor.
  
  :param model: The model to compute RAI insights for.
      A model that implements sklearn.predict or sklearn.predict_proba
      or function that accepts a 2d ndarray.
  :type model: object
  :param test: The test dataset including the label column.
  :type test: 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 task_type: The task to run, can be `classification` or
      `regression`.
  :type task_type: str
  :param classes: The class labels in the training dataset
  :type classes: numpy.ndarray
  :param serializer: Picklable custom serializer with save and load
      methods defined for model that is not serializable. The save
      method returns a dictionary state and load method returns the
      model.
  :type serializer: object
  :param maximum_rows_for_test: Limit on size of test data
      (for performance reasons)
  :type maximum_rows_for_test: int
docstr_tok: ["Validate","the","inputs","for","the","RAITextInsights","constructor",".",":","param","model",":","The","model","to","compute","RAI","insights","for",".","A","model","that","implements","sklearn.predict","or","sklearn.predict_proba","or","function","that","accepts","a","2d","ndarray",".",":","type","model",":","object",":","param","test",":","The","test","dataset","including","the","label","column",".",":","type","test",":","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","task_type",":","The","task","to","run",",","can","be","`","classification","`","or","`","regression","`",".",":","type","task_type",":","str",":","param","classes",":","The","class","labels","in","the","training","dataset",":","type","classes",":","numpy.ndarray",":","param","serializer",":","Picklable","custom","serializer","with","save","and","load","methods","defined","for","model","that","is","not","serializable",".","The","save","method","returns","a","dictionary","state","and","load","method","returns","the","model",".",":","type","serializer",":","object",":","param","maximum_rows_for_test",":","Limit","on","size","of","test","data","(","for","performance","reasons",")",":","type","maximum_rows_for_test",":","int"]
code: def _validate_rai_insights_input_parameters(
      self,
      model: Any,
      test: pd.DataFrame,
      target_column: Union[str, List],
      task_type: str,
      classes: np.ndarray,
      serializer,
      maximum_rows_for_test: int,
      text_column: Optional[Union[str, List]],
  ):
      """Validate the inputs for the RAITextInsights constructor.
  
      :param model: The model to compute RAI insights for.
          A model that implements sklearn.predict or sklearn.predict_proba
          or function that accepts a 2d ndarray.
      :type model: object
      :param test: The test dataset including the label column.
      :type test: 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 task_type: The task to run, can be `classification` or
          `regression`.
      :type task_type: str
      :param classes: The class labels in the training dataset
      :type classes: numpy.ndarray
      :param serializer: Picklable custom serializer with save and load
          methods defined for model that is not serializable. The save
          method returns a dictionary state and load method returns the
          model.
      :type serializer: object
      :param maximum_rows_for_test: Limit on size of test data
          (for performance reasons)
      :type maximum_rows_for_test: int
      """
  
      valid_tasks = [
          ModelTask.TEXT_CLASSIFICATION.value,
          ModelTask.MULTILABEL_TEXT_CLASSIFICATION.value,
          ModelTask.SENTIMENT_ANALYSIS.value,
          ModelTask.QUESTION_ANSWERING.value,
          ModelTask.ENTAILMENT.value,
          ModelTask.SUMMARIZATIONS.value,
      ]
  
      if task_type not in valid_tasks:
          message = (
              f"Unsupported task type '{task_type}'. "
              f"Should be one of {valid_tasks}"
          )
          raise UserConfigValidationException(message)
  
      if model is None:
          warnings.warn(
              "INVALID-MODEL-WARNING: No valid model is supplied. "
              "Explanations will not work"
          )
  
      if serializer is not None:
          self._validate_serializer(serializer)
  
      test_is_pd = isinstance(test, pd.DataFrame)
      if not test_is_pd:
          raise UserConfigValidationException(
              "Unsupported data type for test dataset. "
              "Expecting pandas DataFrame."
          )
  
      if test.shape[0] > maximum_rows_for_test:
          msg_fmt = (
              "The test data has {0} rows, "
              + "but limit is set to {1} rows. "
              + "Please resample the test data or "
              + "adjust maximum_rows_for_test"
          )
          raise UserConfigValidationException(
              msg_fmt.format(test.shape[0], maximum_rows_for_test)
          )
  
      if task_type == ModelTask.MULTILABEL_TEXT_CLASSIFICATION.value:
          if not isinstance(target_column, list):
              raise UserConfigValidationException(
                  "The target_column should be a list for multilabel "
                  "classification"
              )
          # check all target columns are present in test
          target_columns_set = set(target_column)
          if not target_columns_set.issubset(set(test.columns)):
              raise UserConfigValidationException(
                  "The list of target_column(s) should be in test data"
              )
      else:
          if target_column not in list(test.columns):
              raise UserConfigValidationException(
                  "Target name {0} not present in test data".format(
                      target_column
                  )
              )
  
      if text_column:
          if task_type == ModelTask.QUESTION_ANSWERING.value:
              if not isinstance(text_column, list):
                  raise UserConfigValidationException(
                      "The text_column should be a list for question "
                      + "answering"
                  )
              text_columns_set = set(text_column)
              if not text_columns_set.issubset(set(test.columns)):
                  raise UserConfigValidationException(
                      "The list of text_column(s) should be in test data"
                  )
          else:
              if text_column not in test.columns:
                  raise UserConfigValidationException(
                      "The text_column should be in test data"
                  )
  
      if (
          classes is not None
          and task_type == ModelTask.TEXT_CLASSIFICATION
      ):
          if len(set(test[target_column].unique()) - set(classes)) != 0:
              raise UserConfigValidationException(
                  "The test labels are not a subset of the "
                  "distinct values in target (test data)"
              )
  
      if model is not None:
          self._validate_model(
              model, test, target_column, task_type, text_column
          )
  
imports: import json
  import logging
  import pickle
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from ml_wrappers import wrap_model
  from erroranalysis._internal.cohort_filter import FilterDataWithCohortFilters
  from raiutils.data_processing import convert_to_list, serialize_json_safe
  from raiutils.models import SKLearn, is_classifier
  from responsibleai._interfaces import Dataset, RAIInsightsData
  from responsibleai._internal.constants import ManagerNames, Metadata, SerializationAttributes
  from responsibleai.exceptions import UserConfigValidationException
  from responsibleai.feature_metadata import FeatureMetadata
  from responsibleai.rai_insights.rai_base_insights import RAIBaseInsights
  from responsibleai_text.common.constants import ModelTask
  from responsibleai_text.managers.error_analysis_manager import ErrorAnalysisManager
  from responsibleai_text.managers.explainer_manager import ExplainerManager
  from responsibleai_text.utils.feature_extractors import extract_features, get_text_columns
label_desc: Use image node_id 6 for calling the RAITextInsights obj's underlying member method code with example usage: obj._validate_rai_insights_input_parameters(model, test, target_column, task_type, classes, serializer, maximum_rows_for_test, text_column) without return types