class_docstr: Builds a `tf.keras.Model`.
  
  This class implements the `ModelBuilderWithMask` by delegating the class
  behaviors to the following implementors that can be specified by callers:
  
     * input_creator: A callable or a class like `InputCreator` to implement
     `create_inputs`.
     * preprocessor: A callable or a class like `Preprocessor` to implement
     `preprocess`.
     * scorer: A callable or a class like `Scorer` to implement `score`.
  
  Users can subclass those implementor classes and pass the objects into this
  class to build a `tf.keras.Model`.
  
  Example usage:
  
  ```python
  model_builder = ModelBuilder(
      input_creator=FeatureSpecInputCreator(
          {},
          {"example_feature_1": tf.io.FixedLenFeature(
              shape=(1,), dtype=tf.float32, default_value=0.0)}),
      preprocessor=PreprocessorWithSpec(),
      scorer=DNNScorer(hidden_layer_dims=[16]),
      mask_feature_name="list_mask",
      name="model_builder")
  ```
docstr: Initializes the instance.
  
  Args:
    input_creator: A callable or a class like `InputCreator` to implement
      `create_inputs`.
    preprocessor: A callable or a class like `Preprocessor` to implement
      `preprocess`.
    scorer: A callable or a class like `Scorer` to implement `score`.
    mask_feature_name: name of 2D mask boolean feature.
    name: (optional) name of the Model.
docstr_tok: ["Initializes","the","instance",".","Args",":","input_creator",":","A","callable","or","a","class","like","`","InputCreator","`","to","implement","`","create_inputs","`",".","preprocessor",":","A","callable","or","a","class","like","`","Preprocessor","`","to","implement","`","preprocess","`",".","scorer",":","A","callable","or","a","class","like","`","Scorer","`","to","implement","`","score","`",".","mask_feature_name",":","name","of","2D","mask","boolean","feature",".","name",":","(","optional",")","name","of","the","Model","."]
code: def __init__(
      self,
      input_creator: Callable[[], Tuple[TensorDict, TensorDict]],
      preprocessor: Callable[
          [TensorDict, TensorDict, tf.Tensor],
          Tuple[TensorDict, TensorDict],
      ],
      scorer: Callable[
          [TensorDict, TensorDict, tf.Tensor],
          Union[TensorLike, TensorDict],
      ],
      mask_feature_name: str,
      name: Optional[str] = None,
  ):
      """Initializes the instance.
  
      Args:
        input_creator: A callable or a class like `InputCreator` to implement
          `create_inputs`.
        preprocessor: A callable or a class like `Preprocessor` to implement
          `preprocess`.
        scorer: A callable or a class like `Scorer` to implement `score`.
        mask_feature_name: name of 2D mask boolean feature.
        name: (optional) name of the Model.
      """
      super().__init__(mask_feature_name, name)
      self._input_creator = input_creator
      self._preprocessor = preprocessor
      self._scorer = scorer
  
imports: import abc
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from absl import logging
  import tensorflow
  from tensorflow_ranking.python.keras import feature
  from tensorflow_ranking.python.keras import layers
label_desc: Use image node_id 1 to create a new ModelBuilder object from inherited base classes: ModelBuilderWithMask with example: obj = ModelBuilder(input_creator, preprocessor, scorer, mask_feature_name, name)