docstr: Get prediction for the queries
  Args:
      queries: text sequences
      batch_size: batch size to use during inference
      max_seq_length: sequences longer than max_seq_length will get truncated. default -1 disables truncation.
  Returns:
      all_preds: model predictions
docstr_tok: ["Get","prediction","for","the","queries","Args",":","queries",":","text","sequences","batch_size",":","batch","size","to","use","during","inference","max_seq_length",":","sequences","longer","than","max_seq_length","will","get","truncated",".","default","-1","disables","truncation",".","Returns",":","all_preds",":","model","predictions"]
code: def classifytext(
      self,
      queries: List[str],
      batch_size: int = 1,
      max_seq_length: int = -1,
  ) -> List[int]:
      """
      Get prediction for the queries
      Args:
          queries: text sequences
          batch_size: batch size to use during inference
          max_seq_length: sequences longer than max_seq_length will get truncated. default -1 disables truncation.
      Returns:
          all_preds: model predictions
      """
      # store predictions for all queries in a single list
      all_preds = []
      mode = self.training
      device = next(self.parameters()).device
      try:
          # Switch model to evaluation mode
          self.eval()
          logging_level = logging.get_verbosity()
          logging.set_verbosity(logging.WARNING)
          dataloader_cfg = {
              "batch_size": batch_size,
              "num_workers": 3,
              "pin_memory": False,
          }
          infer_datalayer = self._setup_infer_dataloader(
              dataloader_cfg, queries, max_seq_length
          )
  
          for i, batch in enumerate(infer_datalayer):
              (
                  input_ids,
                  input_type_ids,
                  input_mask,
                  subtokens_mask,
              ) = batch
  
              logits = self.forward(
                  input_ids=input_ids.to(device),
                  token_type_ids=input_type_ids.to(device),
                  attention_mask=input_mask.to(device),
              )
  
              preds = tensor2list(torch.argmax(logits, axis=-1))
              all_preds.extend(preds)
      finally:
          # set mode back to its original value
          self.train(mode=mode)
          logging.set_verbosity(logging_level)
      return all_preds
  
imports: import os
  from typing import Dict, List, Optional
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.common.losses import CrossEntropyLoss
  from nemo.collections.nlp.data.text_classification import TextClassificationDataset, calc_class_weights
  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 SequenceClassifier
  from nemo.collections.nlp.parts.utils_funcs import tensor2list
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.exportable import Exportable
  from nemo.utils import logging
label_desc: Use image node_id 13 for calling the TextClassificationModel obj's underlying member method code with example usage: obj.classifytext(queries, batch_size, max_seq_length) and returns: all_preds