class_docstr: Information retrieval model which encodes query and passage separately
  with two different BERT encoders and computes their similarity score
  as a dot-product between corresponding [CLS] token representations.
class_docstr_tok: ["Information","retrieval","model","which","encodes","query","and","passage","separately","with","two","different","BERT","encoders","and","computes","their","similarity","score","as","a","dot-product","between","corresponding","[","CLS","]","token","representations","."]
code: def _setup_dataloader_from_config(self, cfg: DictConfig):
      dataset = BertInformationRetrievalDataset(
          tokenizer=self.tokenizer,
          passages=cfg.passages,
          queries=cfg.queries,
          query_to_passages=cfg.query_to_passages,
          num_negatives=cfg.num_negatives,
          psg_cache_format=cfg.get("psg_cache_format", "pkl"),
          max_query_length=cfg.get("max_query_length", 31),
          max_passage_length=cfg.get("max_passage_length", 190),
          preprocess_fn="preprocess_dpr",
      )
  
      return torch.utils.data.DataLoader(
          dataset=dataset,
          batch_size=cfg.batch_size,
          shuffle=cfg.shuffle,
          num_workers=cfg.get("num_workers", 2),
          pin_memory=cfg.get("pin_memory", False),
          drop_last=cfg.get("drop_last", False),
      )
  
file_path: NeMo/nemo/collections/nlp/models/information_retrieval/bert_dpr_model.py
imports: from typing import Dict, Optional
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.common.losses import SmoothedCrossEntropyLoss
  from nemo.collections.nlp.data import BertInformationRetrievalDataset
  from nemo.collections.nlp.models.information_retrieval.base_ir_model import BaseIRModel
  from nemo.collections.nlp.modules.common.tokenizer_utils import get_tokenizer
  from nemo.core.classes.common import typecheck
  from nemo.core.neural_types import ChannelType, LogitsType, MaskType, NeuralType
label_desc: Use image node_id 6 for calling the BertDPRModel obj's underlying member method code with example usage: obj._setup_dataloader_from_config(cfg) and returns: torch