class_docstr: Task object for TF-Ranking.
class_docstr_tok: ["Task","object","for","TF-Ranking","."]
code: def __init__(
      self,
      params,
      model_builder: tfr_model.AbstractModelBuilder,
      context_feature_spec: FeatureSpec = None,
      example_feature_spec: FeatureSpec = None,
      label_spec: Tuple[str, tf.io.FixedLenFeature] = None,
      dataset_fn: Optional[Callable[[], tf.data.Dataset]] = None,
      logging_dir: Optional[str] = None,
      name: Optional[str] = None,
  ):
      super().__init__(
          params=params, logging_dir=logging_dir, name=name
      )
      self._model_builder = model_builder
      self._context_feature_spec = context_feature_spec or {}
      self._example_feature_spec = example_feature_spec or {}
      self._label_spec = label_spec
      self._dataset_fn = dataset_fn
  
imports: import dataclasses
  from typing import Callable, Dict, Mapping, Optional, Tuple, Union
  import tensorflow
  from tensorflow_ranking.python import data
  from tensorflow_ranking.python.keras import losses
  from tensorflow_ranking.python.keras import metrics
  from tensorflow_ranking.python.keras import model
label_desc: Use image node_id 1 to create a new RankingTask object from inherited base classes: base_task with example: obj = RankingTask(params, model_builder, context_feature_spec, example_feature_spec, label_spec, dataset_fn, logging_dir, name)