docstr: construct dataloader
  :param data_sign: 'train', 'val' or 'test'
docstr_tok: ["construct","dataloader",":","param","data_sign",":","'train","'",",","'val","'","or","'test","'"]
code: def get_dataloader(self, data_sign="train", ex_params=None):
      """construct dataloader
      :param data_sign: 'train', 'val' or 'test'
      """
      # InputExamples to InputFeatures
      features = self.get_features(
          data_sign=data_sign, ex_params=ex_params
      )
      dataset = FeatureDataset(features)
      print(f"{len(features)} {data_sign} data loaded!")
      print("=*=" * 10)
      # construct dataloader
      # RandomSampler(dataset) or SequentialSampler(dataset)
      if data_sign == "train":
          datasampler = RandomSampler(dataset)
          dataloader = DataLoader(
              dataset,
              sampler=datasampler,
              batch_size=self.train_batch_size,
              collate_fn=self.collate_fn_train,
          )
      elif data_sign == "val":
          datasampler = SequentialSampler(dataset)
          dataloader = DataLoader(
              dataset,
              sampler=datasampler,
              batch_size=self.val_batch_size,
              collate_fn=self.collate_fn_test,
          )
      elif data_sign in (
          "test",
          "pseudo",
          "EPO",
          "SEO",
          "SOO",
          "Normal",
          "1",
          "2",
          "3",
          "4",
          "5",
      ):
          datasampler = SequentialSampler(dataset)
          dataloader = DataLoader(
              dataset,
              sampler=datasampler,
              batch_size=self.test_batch_size,
              collate_fn=self.collate_fn_test,
          )
      else:
          raise ValueError(
              "please notice that the data can only be train/val/test !!"
          )
      return dataloader
  
file_path: DeepKE/src/deepke/triple_extraction/PRGC/dataloader.py
imports: import os
  import json
  import torch
  from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, Dataset
  from transformers import BertTokenizer
  from .dataloader_utils import read_examples, convert_examples_to_features
label_desc: Use image node_id 5 for calling the CustomDataLoader obj's underlying member method code with example usage: obj.get_dataloader(data_sign, ex_params) and returns: dataloader