tfr.extension.premade.TFRBertModelBuilder

Model builder for TFR-BERT models.

Inherits From: ModelBuilder, ModelBuilderWithMask, AbstractModelBuilder

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.

Methods

build

View source

Builds a Keras Model for Ranking Pipeline.

Example usage:

model_builder = SimpleModelBuilder(
    {},
    {"example_feature_1": tf.io.FixedLenFeature(
        shape=(1,), dtype=tf.float32, default_value=0.0)},
    "list_mask", "model_builder")
model = model_builder.build()

Returns
A tf.keras.Model.

create_inputs

View source

See ModelBuilderWithMask.

preprocess

View source

See ModelBuilderWithMask.

score

View source

See ModelBuilderWithMask.