code: def _build_logreg(
      num_classes,
      maxlen,
      max_features,
      features,
      loss_func="categorical_crossentropy",
      activation="softmax",
      metrics=["accuracy"],
      verbose=1,
  ):
      embedding_matrix = np.ones((max_features, 1))
      embedding_matrix[0] = 0
  
      # set up the model
      inp = keras.layers.Input(shape=(maxlen,))
      r = keras.layers.Embedding(
          max_features,
          1,
          input_length=maxlen,
          weights=[embedding_matrix],
          trainable=False,
      )(inp)
      x = keras.layers.Embedding(
          max_features,
          num_classes,
          input_length=maxlen,
          embeddings_initializer="glorot_normal",
      )(inp)
      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
  
file_path: ktrain/ktrain/text/models.py
imports: from ..None import utils
  from ..imports import *
  from .None import preprocessor
label_desc: Use image node_id 6 for calling a global function with example usage: _build_logreg(num_classes, maxlen, max_features, features, loss_func, activation, metrics, verbose) and returns: model