class_docstr: Dataloader for the Jigsaw Unintended Bias in Toxicity Classification.
  Source: https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/
class_docstr_tok: ["Dataloader","for","the","Jigsaw","Unintended","Bias","in","Toxicity","Classification",".","Source",":","https",":","\/\/www.kaggle.com\/c\/jigsaw-unintended-bias-in-toxicity-classification\/"]
code: def __getitem__(self, index):
      meta = {}
      entry = self.data[index]
      text_id = entry["id"]
  
      if "translated" in entry:
          text = entry["translated"]
      elif "comment_text_en" in entry:
          text = entry["comment_text_en"]
      else:
          text = entry["comment_text"]
  
      target_dict = self.filter_entry_labels(
          entry,
          self.classes + self.identity_classes,
          threshold=0.5,
          soft_labels=self.soft_labels,
      )
      meta["multi_target"] = torch.tensor(
          list(target_dict.values()), dtype=torch.float32
      )
      meta["text_id"] = text_id
  
      if self.train:
          meta["weights"] = self.weights[index]
          toxic_weight = (
              self.weights[index]
              * self.loss_weight
              * 1.0
              / len(self.classes)
          )
          identity_weight = (
              (1 - self.loss_weight) * 1.0 / len(self.identity_classes)
          )
          meta["weights1"] = torch.tensor(
              [
                  *[toxic_weight] * len(self.classes),
                  *[identity_weight] * len(self.identity_classes),
              ]
          )
  
      return text, meta
  
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 2 for calling the JigsawDataBias obj's underlying member method code with example usage: obj.__getitem__(index) and returns: text,  meta