inputs = tf.keras.layers.Input(shape=[], dtype=tf.string, name="input_layer")
preprocessor = hub.KerasLayer("https://kaggle.com/models/tensorflow/bert/frameworks/TensorFlow2/variations/en-uncased-preprocess/versions/3")
encoder_inputs = preprocessor(inputs)
encoder = hub.KerasLayer('https://www.kaggle.com/models/tensorflow/bert/frameworks/TensorFlow2/variations/bert-en-uncased-l-10-h-128-a-2/versions/2', trainable=False)
outputs = encoder(encoder_inputs)
pooled_output = outputs["pooled_output"]
sequence_output = outputs["sequence_output"]
x = tf.keras.layers.Dense(32, activation='relu')(pooled_output)
outputs = tf.keras.layers.Dense(1, activation='sigmoid', name='classification')(x)
text_clf = tf.keras.models.Model(inputs=inputs, outputs=outputs)