code: def set_cat_slot(
      predictions_status: dict,
      predictions_value: dict,
      cat_slot_values: Dict[str, List[str]],
  ) -> dict:
      """
      Extract predicted categorical slot information
      Args:
          predictions_status: predicted statuses
          predictions_value: predicted slot values
          cat_slot_values: possible categorical slots and their potential values for this service
      Returns:
          out_dict: predicted slot value pairs
      """
      out_dict = {}
      for slot_idx, slot in enumerate(cat_slot_values):
          slot_status = predictions_status[slot_idx][0][
              "cat_slot_status"
          ]
          if slot_status == STATUS_DONTCARE:
              out_dict[slot] = STR_DONTCARE
          elif slot_status == STATUS_ACTIVE:
              tmp = predictions_value[slot_idx]
              value_idx = max(
                  tmp,
                  key=lambda k: tmp[k]["cat_slot_value_status"][
                      0
                  ].item(),
              )
              out_dict[slot] = cat_slot_values[slot][value_idx]
      return out_dict
  
file_path: NeMo/nemo/collections/nlp/data/dialogue/sgd/prediction_utils.py
imports: import json
  import os
  from collections import OrderedDict, defaultdict
  from typing import Dict, List, Optional
  from nemo.collections.nlp.data.dialogue.input_example.sgd_input_example import STATUS_ACTIVE, STATUS_DONTCARE, STR_DONTCARE
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: set_cat_slot(predictions_status, predictions_value, cat_slot_values) and returns: out_dict