x = keras.layers.dot([x, r], axes=1)
    x = keras.layers.Flatten()(x)
    if activation:
        x = keras.layers.Activation(activation)(x)
    model = keras.Model(inputs=inp, outputs=x)
    model.compile(loss=loss_func, optimizer=U.DEFAULT_OPT, metrics=metrics)
    return model


def _build_bert(
    num_classes,
    maxlen,
    max_features,
    features,
    loss_func=&#34;categorical_crossentropy&#34;,
    activation=&#34;softmax&#34;,
    metrics=[&#34;accuracy&#34;],
    verbose=1,
    preproc=None,
