class_docstr: Task object for tf-ranking BERT.
class_docstr_tok: ["Task","object","for","tf-ranking","BERT","."]
code: def __init__(
      self,
      params,
      label_spec: Tuple[str, tf.io.FixedLenFeature] = None,
      logging_dir: Optional[str] = None,
      name: Optional[str] = None,
      **kwargs,
  ):
      super().__init__(
          params=params,
          model_builder=None,
          label_spec=label_spec,
          logging_dir=logging_dir,
          name=name,
          **kwargs,
      )
      if params.validation_data:
          if (
              params.train_data.mask_feature_name
              != params.validation_data.mask_feature_name
          ):
              raise ValueError(
                  "`mask_feature_name` in train and validation data is "
                  'not matched! "${}" in train but "${}" in '
                  "validation.".format(
                      params.train_data.mask_feature_name,
                      params.validation_data.mask_feature_name,
                  )
              )
  
imports: import dataclasses
  import os
  import time
  from typing import Dict, Mapping, Optional, Tuple
  from absl import logging
  import numpy
  import tensorflow
  from official.core import task_factory
  from official.modeling.hyperparams import base_config
  from official.nlp.configs import encoders
  from tensorflow_ranking.extension import task
  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 TFRBertTask object from inherited base classes: tfr_task with example: obj = TFRBertTask(params, label_spec, logging_dir, name)