docstr: Extract continuous spans of slot_ids
  Args:
      Slot_ids: list of str representing slot of each word token
      For instance, 'O', 'email_address', 'email_address', 'email_address', 'O', 'O', 'O', 'O']
      Corresponds to ['enter', 'atdfd@yahoo', 'dot', 'com', 'into', 'my', 'contact', 'list']
  Returns:
      list of str where each element is a slot name-value pair
      e.g. ['email_address(atdfd@yahoo dot com)']
docstr_tok: ["Extract","continuous","spans","of","slot_ids","Args",":","Slot_ids",":","list","of","str","representing","slot","of","each","word","token","For","instance",",","'","O","'",",","'email_address","'",",","'email_address","'",",","'email_address","'",",","'","O","'",",","'","O","'",",","'","O","'",",","'","O","'","]","Corresponds","to","[","'enter","'",",","'atdfd","@","yahoo","'",",","'dot","'",",","'com","'",",","'into","'",",","'my","'",",","'contact","'",",","'list","'","]","Returns",":","list","of","str","where","each","element","is","a","slot","name-value","pair","e.g",".","[","'email_address","(","atdfd","@","yahoo","dot","com",")","'","]"]
code: def get_continuous_slots(slot_ids, utterance_tokens):
      """
      Extract continuous spans of slot_ids
      Args:
          Slot_ids: list of str representing slot of each word token
          For instance, 'O', 'email_address', 'email_address', 'email_address', 'O', 'O', 'O', 'O']
          Corresponds to ['enter', 'atdfd@yahoo', 'dot', 'com', 'into', 'my', 'contact', 'list']
      Returns:
          list of str where each element is a slot name-value pair
          e.g. ['email_address(atdfd@yahoo dot com)']
  
      """
      slot_id_stack = []
      position_stack = []
      for i, slot_id in enumerate(slot_ids):
          if not slot_id_stack or slot_id != slot_id_stack[-1]:
              slot_id_stack.append(slot_id)
              position_stack.append([])
          position_stack[-1].append(i)
  
      slot_id_to_start_and_exclusive_end = {
          slot_id_stack[i]: [
              position_stack[i][0],
              position_stack[i][-1] + 1,
          ]
          for i in range(len(position_stack))
          if slot_id_stack[i] != "O"
      }
  
      slot_to_words = {
          slot: " ".join(utterance_tokens[position[0] : position[1]])
          for slot, position in slot_id_to_start_and_exclusive_end.items()
      }
  
      slot_name_and_values = [
          "{}({})".format(slot, value)
          for slot, value in slot_to_words.items()
      ]
  
      return slot_name_and_values
  
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 11 for calling the IntentSlotClassificationModel obj's underlying member method code with example usage: obj.get_continuous_slots(slot_ids, utterance_tokens) and returns: slot_name_and_values