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 model.
  
  :param model: The model to validate.
  :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 text_column: The name of the optional text column(s).
      If not provided, and there is additional feature metadata, then
      an exception will be raised.
  :type text_column: str or list[str]
docstr_tok: ["Validate","the","model",".",":","param","model",":","The","model","to","validate",".",":","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","text_column",":","The","name","of","the","optional","text","column","(","s",")",".","If","not","provided",",","and","there","is","additional","feature","metadata",",","then","an","exception","will","be","raised",".",":","type","text_column",":","str","or","list","[","str","]"]
code: def _validate_model(
      self,
      model: Any,
      test: pd.DataFrame,
      target_column: Union[str, List],
      task_type: str,
      text_column: Optional[Union[str, List]],
  ):
      """Validate the model.
  
      :param model: The model to validate.
      :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 text_column: The name of the optional text column(s).
          If not provided, and there is additional feature metadata, then
          an exception will be raised.
      :type text_column: str or list[str]
      """
      if not isinstance(target_column, list):
          target_column = [target_column]
      # Pick one row from test data
      small_test_data = test.iloc[0:1].drop(target_column, axis=1)
      small_test_data = get_text_columns(small_test_data, text_column)
      small_test_data = small_test_data.iloc[0]
      if task_type != ModelTask.QUESTION_ANSWERING:
          small_test_data = small_test_data.tolist()
      # Call the model
      try:
          model.predict(small_test_data)
      except Exception:
          raise UserConfigValidationException(
              "The model passed cannot be used for"
              " getting predictions via predict()"
          )
  
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 5 for calling the RAITextInsights obj's underlying member method code with example usage: obj._validate_model(model, test, target_column, task_type, text_column) without return types