code: def get_lengths(self, idx):
      x_true, y_true = self[idx]
      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: ktrain/ktrain/text/ner/dataset.py
imports: from ...dataset import SequenceDataset
  from ...imports import *
label_desc: Use image node_id 5 for calling the NERSequence obj's underlying member method code with example usage: obj.get_lengths(idx) and returns: lengths