code: def get_lengths(self, y_true):
      lengths = []
      for y in np.argmax(y_true, -1):
          try:
              i = list(y).index(0)
          except ValueError:
              i = len(y)
          lengths.append(i)
  
      return lengths
  
file_path: anago/anago/callbacks.py
imports: import numpy
  from keras.callbacks import Callback
  from seqeval.metrics import f1_score, classification_report
label_desc: Use image node_id 2 for calling the F1score obj's underlying member method code with example usage: obj.get_lengths(y_true) and returns: lengths