callbacks

class EvalCallBack

__init__

Evaluate callback, calculate precision, recall and f1 at the end of each epoch step.

  1. def __init__(self,
  2. kash_model: BaseModel,
  3. valid_x,
  4. valid_y,
  5. step=5,
  6. batch_size=256):

Args:

  • kash_model: the kashgari model to evaluate
  • valid_x: feature data for evaluation
  • valid_y: label data for evaluation
  • step: evaluate step, default 5
  • batch_size: batch size, default 256

Methods

on_epoch_end

  1. def on_epoch_end(self, epoch, logs=None):