callbacks#
class EvalCallBack#
__init__#
Evaluate callback, calculate precision, recall and f1 at the end of each epoch step.
def __init__(self,
kash_model: BaseModel,
valid_x,
valid_y,
step=5,
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#
def on_epoch_end(self, epoch, logs=None):