code: def get_unified_metrics(self, outputs):
      slot_preds = []
      slot_labels = []
      subtokens_mask = []
      inputs = []
      intent_preds = []
      intent_labels = []
  
      for output in outputs:
          slot_preds += output["slot_preds"]
          slot_labels += output["slot_labels"]
          subtokens_mask += output["subtokens_mask"]
          inputs += output["input"]
          intent_preds += output["intent_preds"]
          intent_labels += output["intent_labels"]
  
      ground_truth_labels = self.convert_intent_ids_to_intent_names(
          intent_labels
      )
      generated_labels = self.convert_intent_ids_to_intent_names(
          intent_preds
      )
  
      predicted_slots = self.mask_unused_subword_slots(
          slot_preds, subtokens_mask
      )
      ground_truth_slots = self.mask_unused_subword_slots(
          slot_labels, subtokens_mask
      )
  
      all_generated_slots = []
      all_ground_truth_slots = []
      all_utterances = []
  
      for i in range(len(predicted_slots)):
          utterance_tokens = self.get_utterance_tokens(
              inputs[i], subtokens_mask[i]
          )
          ground_truth_slot_names = ground_truth_slots[i].split()
          predicted_slot_names = predicted_slots[i].split()
          processed_ground_truth_slots = (
              IntentSlotClassificationModel.get_continuous_slots(
                  ground_truth_slot_names, utterance_tokens
              )
          )
          processed_predicted_slots = (
              IntentSlotClassificationModel.get_continuous_slots(
                  predicted_slot_names, utterance_tokens
              )
          )
  
          all_generated_slots.append(processed_predicted_slots)
          all_ground_truth_slots.append(processed_ground_truth_slots)
          all_utterances.append(" ".join(utterance_tokens))
  
      os.makedirs(self.cfg.dataset.dialogues_example_dir, exist_ok=True)
      filename = os.path.join(
          self.cfg.dataset.dialogues_example_dir, "predictions.jsonl"
      )
  
      DialogueClassificationMetrics.save_predictions(
          filename,
          generated_labels,
          all_generated_slots,
          ground_truth_labels,
          all_ground_truth_slots,
          ["" for i in range(len(generated_labels))],
          ["" for i in range(len(generated_labels))],
          all_utterances,
      )
  
      (
          slot_precision,
          slot_recall,
          slot_f1,
          slot_joint_goal_accuracy,
      ) = DialogueClassificationMetrics.get_slot_filling_metrics(
          all_generated_slots, all_ground_truth_slots
      )
  
      return (
          slot_precision,
          slot_recall,
          slot_f1,
          slot_joint_goal_accuracy,
      )
  
imports: import os
  from typing import Dict, List, Optional
  import torch
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from torch.utils.data import DataLoader
  from nemo.collections.common.losses import AggregatorLoss, CrossEntropyLoss
  from nemo.collections.nlp.data.dialogue.data_processor.assistant_data_processor import DialogueAssistantDataProcessor
  from nemo.collections.nlp.data.dialogue.dataset.dialogue_bert_dataset import DialogueBERTDataset, DialogueIntentSlotInferenceDataset
  from nemo.collections.nlp.data.intent_slot_classification import IntentSlotDataDesc
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  from nemo.collections.nlp.metrics.dialogue_metrics import DialogueClassificationMetrics
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.collections.nlp.modules.common import SequenceTokenClassifier
  from nemo.collections.nlp.parts.utils_funcs import tensor2list
  from nemo.core.classes import typecheck
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.utils import logging
label_desc: Use image node_id 13 for calling the IntentSlotClassificationModel obj's underlying member method code with example usage: obj.get_unified_metrics(outputs) and returns: slot_precision,  slot_recall,  slot_f1,  slot_joint_goal_accuracy