code: def get_classification_report(
      labels, preds, label_ids, output_dict=False
  ):
      """
      Returns classification report
      """
      # remove labels from label_ids that don't appear in predictions or ground truths
      used_labels = set(labels) | set(preds)
      labels_names = [
          k + " (label id: " + str(v) + ")"
          for k, v in sorted(
              label_ids.items(), key=lambda item: item[1]
          )
          if v in used_labels
      ]
  
      return classification_report(
          labels,
          preds,
          target_names=labels_names,
          digits=4,
          output_dict=output_dict,
      )
  
imports: import os
  import time
  from typing import Callable, Dict, List, Optional, Union
  import numpy
  import torch
  import torch.nn.functional
  from matplotlib import pyplot
  from sklearn.metrics import classification_report, confusion_matrix
  from torch import Tensor
  from nemo.collections.nlp.modules.common.megatron.utils import erf_gelu
  from nemo.collections.nlp.modules.common.megatron.utils import openai_gelu
  from nemo.collections.nlp.modules.common.megatron.utils import squared_relu
  from nemo.utils import logging
label_desc: Use image node_id 6 for calling a global function with example usage: get_classification_report(labels, preds, label_ids, output_dict) and returns: classification_report