metrics values on the given batch, if labels are given
predictions, otherwise
if isinstance(texts[0], str):
texts = self.tokenizer(list(texts))
if labels:
features = self.texts2vec(texts)
onehot_labels = labels2onehot(labels, classes=self.classes)
metrics_values = self.model.test_on_batch(features, onehot_labels)
After Change
metrics values on the given batch, if labels are given
predictions, otherwise
K.set_session(self.sess)
if labels:
features = self.pad_texts(texts)
onehot_labels = labels2onehot(labels, classes=self.classes)
metrics_values = self.model.test_on_batch(features, onehot_labels)