code: def set_noncat_slot(
      predictions_status: dict,
      predictions_value: dict,
      non_cat_slots: List[str],
      user_utterance: str,
      sys_slots_agg: Optional[dict] = None,
  ) -> dict:
      """
      Extract predicted non categorical slot information
      Args:
          predictions_status: predicted statuses
          predictions_value: predicted slot values
          non_cat_slots: list of possible non categorical slots for this service
          user_utterance: system and user utterance
          sys_slots_agg: system retrieval lookup table. Contains for each slot the most recent value seen in the history
      Returns:
          out_dict: predicted slot value pairs
      """
      out_dict = {}
      for slot_idx, slot in enumerate(non_cat_slots):
          slot_status = predictions_status[slot_idx][0][
              "noncat_slot_status"
          ]
          if slot_status == STATUS_DONTCARE:
              out_dict[slot] = STR_DONTCARE
          elif slot_status == STATUS_ACTIVE:
              tok_start_idx = predictions_value[slot_idx][0][
                  "noncat_slot_start"
              ]
              tok_end_idx = predictions_value[slot_idx][0][
                  "noncat_slot_end"
              ]
              ch_start_idx = predictions_value[slot_idx][0][
                  "noncat_alignment_start"
              ][tok_start_idx]
              ch_end_idx = predictions_value[slot_idx][0][
                  "noncat_alignment_end"
              ][tok_end_idx]
              if ch_start_idx > 0 and ch_end_idx > 0:
                  # Add span from the utterance.
                  out_dict[slot] = user_utterance[
                      ch_start_idx - 1 : ch_end_idx
                  ]
              elif sys_slots_agg and slot in sys_slots_agg:
                  # system retrieval
                  out_dict[slot] = sys_slots_agg[slot]
      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 2 for calling a global function with example usage: set_noncat_slot(predictions_status, predictions_value, non_cat_slots, user_utterance, sys_slots_agg) and returns: out_dict