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","."]
code: def _get_dataset(self):
      dashboard_dataset = Dataset()
      tasktype = self.task_type
      if isinstance(tasktype, Enum):
          tasktype = tasktype.value
      dashboard_dataset.task_type = tasktype
      categorical_features = self._feature_metadata.categorical_features
      if categorical_features is None:
          categorical_features = []
      dashboard_dataset.categorical_features = categorical_features
      dashboard_dataset.class_names = convert_to_list(self._classes)
      is_classification_task = self._is_classification_task
      dataset = self._get_test_text_data(is_classification_task)
  
      predicted_y = None
      if dataset is not None and self._wrapped_model is not None:
          try:
              predicted_y = self._wrapped_model.predict(dataset)
          except Exception as ex:
              msg = (
                  "Model does not support predict method for given "
                  "dataset type"
              )
              raise ValueError(msg) from ex
          try:
              predicted_y = convert_to_list(predicted_y)
          except Exception as ex:
              raise ValueError(
                  "Model prediction output of unsupported type,"
              ) from ex
      if predicted_y is not None:
          if is_classification_task:
              predicted_y = self._convert_labels(
                  predicted_y, dashboard_dataset.class_names
              )
          dashboard_dataset.predicted_y = predicted_y
      row_length = len(dataset)
  
      dashboard_dataset.features = self._ext_test
  
      true_y = self.test[self.target_column]
      if true_y is not None and len(true_y) == row_length:
          true_y = convert_to_list(true_y)
          if is_classification_task:
              true_y = self._convert_labels(
                  true_y, dashboard_dataset.class_names
              )
          dashboard_dataset.true_y = true_y
  
      dashboard_dataset.feature_names = self._ext_features
      dashboard_dataset.target_column = self.target_column
      if is_classifier(self._wrapped_model) and dataset is not None:
          try:
              probability_y = self._wrapped_model.predict_proba(dataset)
          except Exception as ex:
              raise ValueError(
                  "Model does not support predict_proba method"
                  " for given dataset type,"
              ) from ex
          try:
              probability_y = convert_to_list(probability_y)
          except Exception as ex:
              raise ValueError(
                  "Model predict_proba output of unsupported type,"
              ) from ex
          dashboard_dataset.probability_y = probability_y
  
      return dashboard_dataset
  
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 16 for calling the RAITextInsights obj's underlying member method code with example usage: obj._get_dataset() and returns: dashboard_dataset