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: Load the ErrorAnalysisManager from the given path.
  
  :param path: The directory path to load the ErrorAnalysisManager from.
  :type path: str
  :param rai_insights: The loaded parent RAIInsights.
  :type rai_insights: RAIInsights
  :return: The ErrorAnalysisManager manager after loading.
  :rtype: ErrorAnalysisManager
docstr_tok: ["Load","the","ErrorAnalysisManager","from","the","given","path",".",":","param","path",":","The","directory","path","to","load","the","ErrorAnalysisManager","from",".",":","type","path",":","str",":","param","rai_insights",":","The","loaded","parent","RAIInsights",".",":","type","rai_insights",":","RAIInsights",":","return",":","The","ErrorAnalysisManager","manager","after","loading",".",":","rtype",":","ErrorAnalysisManager"]
code: def _load(path, rai_insights):
      """Load the ErrorAnalysisManager from the given path.
  
      :param path: The directory path to load the ErrorAnalysisManager from.
      :type path: str
      :param rai_insights: The loaded parent RAIInsights.
      :type rai_insights: RAIInsights
      :return: The ErrorAnalysisManager manager after loading.
      :rtype: ErrorAnalysisManager
      """
      # create the ErrorAnalysisManager without any properties using
      # the __new__ function, similar to pickle
      inst = ErrorAnalysisManager.__new__(ErrorAnalysisManager)
  
      ea_config_list = []
      ea_report_list = []
      all_ea_dirs = DirectoryManager.list_sub_directories(path)
      for ea_dir in all_ea_dirs:
          directory_manager = DirectoryManager(
              parent_directory_path=path, sub_directory_name=ea_dir
          )
  
          config_path = (
              directory_manager.get_config_directory() / "config.json"
          )
          with open(config_path, "r") as file:
              ea_config = json.load(file, object_hook=as_error_config)
              ea_config_list.append(ea_config)
  
          report_path = (
              directory_manager.get_data_directory() / "report.json"
          )
          with open(report_path, "r") as file:
              ea_report = json.load(file, object_hook=as_error_report)
              # Validate the serialized output against schema
              schema = ErrorAnalysisManager._get_error_analysis_schema()
              jsonschema.validate(
                  json.loads(ea_report.to_json()), schema
              )
              ea_report_list.append(ea_report)
  
      inst.__dict__["_ea_report_list"] = ea_report_list
      inst.__dict__["_ea_config_list"] = ea_config_list
  
      feature_metadata = rai_insights._feature_metadata
      categorical_features = feature_metadata.categorical_features
      inst.__dict__["_categorical_features"] = categorical_features
      target_column = rai_insights.target_column
      true_y = rai_insights._ext_test_df[target_column]
      if isinstance(target_column, list):
          dropped_cols = target_column
      else:
          dropped_cols = [target_column]
      dataset = rai_insights._ext_test_df.drop(columns=dropped_cols)
      inst.__dict__["_dataset"] = dataset
      feature_names = list(dataset.columns)
      inst.__dict__["_feature_names"] = feature_names
      wrapped_model = wrap_model(
          rai_insights.model, dataset, rai_insights.task_type
      )
      is_multilabel = False
      index_classes = rai_insights._classes
      index_dataset = rai_insights.test
      if isinstance(target_column, list):
          index_dataset = index_dataset.copy()
          index_classes = target_column
          labels = _concat_labels_column(
              index_dataset, target_column, index_classes
          )
          index_dataset.drop(columns=target_column, inplace=True)
          index_dataset[LABELS] = labels
          target_column = LABELS
          is_multilabel = True
          true_y = index_dataset[target_column]
      inst.__dict__["_true_y"] = true_y
      inst.__dict__["_task_type"] = rai_insights.task_type
      text_column = rai_insights._text_column
      index_predictor = ErrorAnalysisManager._create_index_predictor(
          wrapped_model,
          index_dataset,
          target_column,
          text_column,
          is_multilabel,
          rai_insights.task_type,
          index_classes,
      )
      inst.__dict__["_analyzer"] = ModelAnalyzer(
          index_predictor,
          dataset,
          true_y,
          feature_names,
          categorical_features,
      )
      return inst
  
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 3 for calling the ErrorAnalysisManager obj's underlying member method code with example usage: obj._load(path, rai_insights) and returns: inst