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
  
      device = "cuda" if torch.cuda.is_available() else "cpu"
  
      # 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
          intent_preds = tensor2list(
              torch.argmax(intent_logits, axis=-1)
          )
          predicted_intents += self.convert_intent_ids_to_intent_names(
              intent_preds
          )
  
          # predict slots
          slot_preds = torch.argmax(slot_logits, axis=-1)
          predicted_slots += self.mask_unused_subword_slots(
              slot_preds, subtokens_mask
          )
  
      # set mode back to its original value
      self.train(mode=mode)
  
      return predicted_intents, predicted_slots
  
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 23 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