Solved by ptrblck in post #2 
              
              
                You could create a mapping between the class indices and the corresponding names using a dict: 
idx_to_name = {
  0: 'class0',
  1: 'class1',
  ...
}

print(idx_to_name[target])