code: def __init__(
      self,
      data_file: str,
      batch_size: int,
      max_sequence: int,
      vectorizer: Vectorizer,
  ):
      self.vectorizer: Vectorizer = vectorizer
      self.max_sequence: int = max_sequence + 2
      df = pd.read_csv(data_file)
      df[
          ["input_ids", "attention_mask", "token_type_ids"]
      ] = df.progress_apply(
          lambda row: pd.Series(
              self.vectorizer.vectorize(
                  title=row["title"], max_seq_length=self.max_sequence
              )
          ),
          axis=1,
      )
      df["y_target"] = df["category"].progress_apply(
          lambda x: self.vectorizer.target_vocab.lookup_token(x)
      )
      train_df, val_df, test_df = (
          df[df.split == mode][
              [
                  "input_ids",
                  "attention_mask",
                  "token_type_ids",
                  "y_target",
              ]
          ]
          for mode in ["train", "val", "test"]
      )
      super().__init__(
          train_set=DataFrameDataset(train_df),
          train_batch_size=batch_size,
          val_set=DataFrameDataset(val_df),
          val_batch_size=batch_size,
          test_set=DataFrameDataset(test_df),
          test_batch_size=batch_size,
      )
  
file_path: transfer-nlp/experiments/bert/bert.py
imports: import logging
  from pathlib import Path
  from typing import Tuple
  import numpy
  import pandas
  from pytorch_pretrained_bert import BertTokenizer, BertForSequenceClassification, BertAdam
  from tqdm import tqdm
  from transfer_nlp.loaders.loaders import DatasetSplits, DataFrameDataset
  from transfer_nlp.loaders.vectorizers import Vectorizer
  from transfer_nlp.loaders.vocabulary import Vocabulary
  from transfer_nlp.plugins.config import register_plugin, ExperimentConfig
label_desc: Use image node_id 1 to create a new BertDataloader object from inherited base classes: DatasetSplits with example: obj = BertDataloader(data_file, batch_size, max_sequence, vectorizer)