class_docstr: Token Classification Model with BERT, applicable for tasks such as Named Entity Recognition
class_docstr_tok: ["Token","Classification","Model","with","BERT",",","applicable","for","tasks","such","as","Named","Entity","Recognition"]
docstr: Setup function for an infer data loader.
  
  Args:
      queries: text
      batch_size: batch size to use during inference
  
  Returns:
      A pytorch DataLoader.
docstr_tok: ["Setup","function","for","an","infer","data","loader",".","Args",":","queries",":","text","batch_size",":","batch","size","to","use","during","inference","Returns",":","A","pytorch","DataLoader","."]
code: def _setup_infer_dataloader(
      self, queries: List[str], batch_size: int
  ) -> "torch.utils.data.DataLoader":
      """
      Setup function for an infer data loader.
  
      Args:
          queries: text
          batch_size: batch size to use during inference
  
      Returns:
          A pytorch DataLoader.
      """
  
      dataset = BertTokenClassificationInferDataset(
          tokenizer=self.tokenizer, queries=queries, max_seq_length=-1
      )
  
      return torch.utils.data.DataLoader(
          dataset=dataset,
          collate_fn=dataset.collate_fn,
          batch_size=batch_size,
          shuffle=False,
          num_workers=self._cfg.dataset.num_workers,
          pin_memory=self._cfg.dataset.pin_memory,
          drop_last=False,
      )
  
imports: import os
  from typing import List, Optional, Union
  import torch
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from torch.utils.data import DataLoader
  from nemo.collections.common.losses import CrossEntropyLoss
  from nemo.collections.nlp.data.data_utils.data_preprocessing import get_labels_to_labels_id_mapping
  from nemo.collections.nlp.data.token_classification.token_classification_dataset import BertTokenClassificationDataset, BertTokenClassificationInferDataset
  from nemo.collections.nlp.data.token_classification.token_classification_utils import get_label_ids
  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 TokenClassifier
  from nemo.collections.nlp.parts.utils_funcs import get_classification_report, plot_confusion_matrix, tensor2list
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.utils import logging
label_desc: Use image node_id 14 for calling the TokenClassificationModel obj's underlying member method code with example usage: obj._setup_infer_dataloader(queries, batch_size) and returns: torch