class_docstr: Task is the central place to define and wire up components for data processing,
  model training, metric reporting, etc. Task class has a Config class containing
  the config of each component in a descriptive way.
class_docstr_tok: ["Task","is","the","central","place","to","define","and","wire","up","components","for","data","processing",",","model","training",",","metric","reporting",",","etc",".","Task","class","has","a","Config","class","containing","the","config","of","each","component","in","a","descriptive","way","."]
code: def __init__(
      self,
      trainer: Trainer,
      data_handler: DataHandler,
      model: Model,
      metric_reporter: MetricReporter,
      exporter: Optional[ModelExporter],
  ) -> None:
      self.trainer: Trainer = trainer
      self.data_handler: DataHandler = data_handler
      self.model: Model = model
      self.metric_reporter: MetricReporter = metric_reporter
      self.exporter = exporter
      log_class_usage(__class__)
  
imports: from typing import List, Optional
  from pytext.common.constants import BatchContext
  from pytext.config import ConfigBase
  from pytext.config.component import Component, ComponentType, create_component, create_data_handler, create_exporter, create_featurizer, create_metric_reporter, create_model, create_trainer
  from pytext.config.field_config import FeatureConfig
  from pytext.data import DataHandler
  from pytext.data.featurizer import Featurizer, SimpleFeaturizer
  from pytext.exporters import ModelExporter
  from pytext.loss import KLDivergenceBCELoss, KLDivergenceCELoss
  from pytext.metric_reporters import MetricReporter
  from pytext.models import Model
  from pytext.trainers import Trainer
  from pytext.utils import cuda
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 2 to create a new TaskBase object from inherited base classes: Component with example: obj = TaskBase(trainer, data_handler, model, metric_reporter, exporter)