code: def get_taxonomy(labels):
      """
      Converting the labels to shogun compatible format
      (i.e. 0, 1, ... num_classes - 1) and getting taxonomy of the labels
      """
      labels = labels.split(",")
      num_labels = len(labels)
      # taking the root label into consideration
      num_labels += 1
      shogun_labels = dict()
      taxonomy = np.zeros(num_labels, dtype=np.int32)
      # considering the root_label node index to be 0
      taxonomy[0] = -1
      for i, label in enumerate(labels):
          shogun_labels[label] = i + 1
          try:
              parent_label = label[:-2]
              parent_idx = labels.index(parent_label) + 1
              taxonomy[i + 1] = parent_idx
          except ValueError:
              taxonomy[i + 1] = 0
      return shogun_labels, taxonomy
  
file_path: shogun/examples/undocumented/python/structure_hierarchical_multilabel_classification.py
imports: import shogun
  import numpy
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: get_taxonomy(labels) and returns: shogun_labels,  taxonomy