class_docstr: Learner for Sequence Taggers.
class_docstr_tok: ["Learner","for","Sequence","Taggers","."]
docstr: Makes predictions on validation set
docstr_tok: ["Makes","predictions","on","validation","set"]
code: def predict(self, val_data=None):
      """
      Makes predictions on validation set
      """
      if val_data is not None:
          val = val_data
      else:
          val = self.val_data
      if val is None:
          raise Exception(
              "val_data must be supplied to get_learner or predict"
          )
      steps = np.ceil(U.nsamples_from_data(val) / val.batch_size)
      results = []
      for idx, (X, y) in enumerate(val):
          y_pred = self.model.predict_on_batch(X)
          lengths = val.get_lengths(idx)
          y_pred = val.p.inverse_transform(y_pred, lengths)
          results.extend(y_pred)
      return results
  
file_path: ktrain/ktrain/text/ner/learner.py
imports: from ...None import utils
  from ...core import GenLearner
  from ...imports import *
  from .None import metrics
label_desc: Use image node_id 6 for calling the NERLearner obj's underlying member method code with example usage: obj.predict(val_data) and returns: results