class_docstr: Base dataloader for the Jigsaw Toxic Comment Classification Challenges.
class_docstr_tok: ["Base","dataloader","for","the","Jigsaw","Toxic","Comment","Classification","Challenges","."]
code: def load_data(self, csv_file):
      change_names = {
          "target": "toxicity",
          "toxic": "toxicity",
          "identity_hate": "identity_attack",
          "severe_toxic": "severe_toxicity",
      }
      if isinstance(csv_file, list):
          files = []
          for file in tqdm(csv_file):
              chunks = []
              for chunk in pd.read_csv(file, chunksize=100000):
                  chunks.append(chunk)
  
              file_df = pd.concat(chunks, axis=0)
              filtered_change_names = {
                  k: v
                  for k, v in change_names.items()
                  if k in file_df.columns
              }
              if len(filtered_change_names) > 0:
                  file_df.rename(
                      columns=filtered_change_names, inplace=True
                  )
              file_df = file_df.astype({"id": "string"})
              files.append(file_df)
  
          final_df = pd.concat(files, join="outer")
      elif isinstance(csv_file, str):
          final_df = pd.read_csv(csv_file)
          filtered_change_names = {
              k: v
              for k, v in change_names.items()
              if k in final_df.columns
          }
          if len(filtered_change_names) > 0:
              final_df.rename(
                  columns=filtered_change_names, inplace=True
              )
      return final_df
  
imports: import datasets
  import numpy
  import pandas
  import torch
  from torch.utils.data.dataset import Dataset
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling the JigsawData obj's underlying member method code with example usage: obj.load_data(csv_file) and returns: final_df