nlp_architect.nn.tensorflow.python.keras package


nlp_architect.nn.tensorflow.python.keras.callbacks module

class nlp_architect.nn.tensorflow.python.keras.callbacks.ConllCallback(x, y, y_vocab, batch_size=1)[source]

Bases: tensorflow.python.keras.callbacks.Callback

A Tensorflow(Keras) Conlleval evaluator. Runs the conlleval script for given x and y inputs. Prints Conlleval F1 score on the end of each epoch.

  • x – features matrix
  • y – labels matrix
  • y_vocab (dict) – int-to-str labels lexicon
  • batch_size (int, optional) – batch size
on_epoch_end(epoch, logs=None)[source]

Called at the end of an epoch.

Subclasses should override for any actions to run. This function should only be called during TRAIN mode.

  • epoch – integer, index of epoch.
  • logs – dict, metric results for this training epoch, and for the validation epoch if validation is performed. Validation result keys are prefixed with val_.

Module contents