docstr: Get prediction for the queries (intent and slots)
  Args:
      queries: text sequences
      test_ds: Dataset configuration section.
  Returns:
      predicted_intents, predicted_slots: model intent and slot predictions
docstr_tok: ["Get","prediction","for","the","queries","(","intent","and","slots",")","Args",":","queries",":","text","sequences","test_ds",":","Dataset","configuration","section",".","Returns",":","predicted_intents",",","predicted_slots",":","model","intent","and","slot","predictions"]
code: def predict_from_examples(
      self, queries: List[str], test_ds
  ) -> List[List[str]]:
      """
      Get prediction for the queries (intent and slots)
      Args:
          queries: text sequences
          test_ds: Dataset configuration section.
      Returns:
          predicted_intents, predicted_slots: model intent and slot predictions
      """
      predicted_intents = []
      predicted_slots = []
      mode = self.training
      try:
          device = "cuda" if torch.cuda.is_available() else "cpu"
  
          # Retrieve intent and slot vocabularies from configuration.
          intent_labels = self.cfg.data_desc.intent_labels
          slot_labels = self.cfg.data_desc.slot_labels
  
          # Initialize tokenizer.
          # if not hasattr(self, "tokenizer"):
          #    self._setup_tokenizer(self.cfg.tokenizer)
          # Initialize modules.
          # self._reconfigure_classifier()
  
          # Switch model to evaluation mode
          self.eval()
          self.to(device)
  
          # Dataset.
          infer_datalayer = self._setup_infer_dataloader(
              queries, test_ds
          )
  
          for batch in infer_datalayer:
              (
                  input_ids,
                  input_type_ids,
                  input_mask,
                  loss_mask,
                  subtokens_mask,
              ) = batch
  
              intent_logits, slot_logits = self.forward(
                  input_ids=input_ids.to(device),
                  token_type_ids=input_type_ids.to(device),
                  attention_mask=input_mask.to(device),
              )
  
              # predict intents and slots for these examples
              # intents
              intent_preds = tensor2list(
                  torch.argmax(intent_logits, axis=-1)
              )
  
              # convert numerical outputs to Intent and Slot labels from the dictionaries
              for intent_num in intent_preds:
                  if intent_num < len(intent_labels):
                      predicted_intents.append(
                          intent_labels[int(intent_num)]
                      )
                  else:
                      # should not happen
                      predicted_intents.append("Unknown Intent")
  
              # slots
              slot_preds = torch.argmax(slot_logits, axis=-1)
  
              for slot_preds_query, mask_query in zip(
                  slot_preds, subtokens_mask
              ):
                  query_slots = ""
                  for slot, mask in zip(slot_preds_query, mask_query):
                      if mask == 1:
                          if slot < len(slot_labels):
                              query_slots += (
                                  slot_labels[int(slot)] + " "
                              )
                          else:
                              query_slots += "Unknown_slot "
                  predicted_slots.append(query_slots.strip())
  
      finally:
          # set mode back to its original value
          self.train(mode=mode)
  
      return predicted_intents, predicted_slots
  
imports: import os
  import pathlib
  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.intent_slot_classification import IntentSlotClassificationDataset, IntentSlotDataDesc, IntentSlotInferenceDataset
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  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 19 for calling the IntentSlotClassificationModel obj's underlying member method code with example usage: obj.predict_from_examples(queries, test_ds) and returns: predicted_intents,  predicted_slots