class_docstr: Dataset of comments from Wikipedia's Talk page edits. Taken from the Toxic Comments
  Classification Challenge on Kaggle.
  
  <https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge/data>
  
  We convert this data to a binary classification task.
class_docstr_tok: ["Dataset","of","comments","from","Wikipedia","'s","Talk","page","edits",".","Taken","from","the","Toxic","Comments","Classification","Challenge","on","Kaggle",".","<","https",":","\/\/www.kaggle.com\/c\/jigsaw-toxic-comment-classification-challenge\/data",">","We","convert","this","data","to","a","binary","classification","task","."]
code: def build(self, opt):
      self._get_data()
  
      try:
          import pandas as pd
      except ImportError:
          raise ImportError(
              "Please install pandas by running `pip install pandas`"
          )
  
      version = "v1.0"
      read_path = self.data_path
      if not build_data.built(self.data_path, version):
          print("[building data from : " + read_path + "]")
          build_data.make_dir(self.data_path)
          # Read in data
          train = pd.read_csv(os.path.join(read_path, "train.csv"))
          test = pd.read_csv(os.path.join(read_path, "test.csv"))
          test_labels = pd.read_csv(
              os.path.join(read_path, "test_labels.csv")
          )
  
          # Labels for test data; value of -1 indicates it was not used for scoring
          test_labels = test_labels[
              (test_labels.toxic != -1)
              & (test_labels.severe_toxic != -1)
              & (test_labels.obscene != -1)
              & (test_labels.threat != -1)
              & (test_labels.insult != -1)
              & (test_labels.identity_hate != -1)
          ]
  
          # Merge test data with labels
          test = pd.merge(test_labels, test, on="id")
  
          # Split 10% of train data to be valid
          test["data_type"] = "test"
          train["data_type"] = "train"
          valid_set = train.sample(frac=0.1, random_state=42)
          valid_set["data_type"] = "valid"
          train.update(valid_set)
  
          # Combine test and train into one data frame
          total_data = pd.concat(
              [test, train], ignore_index=True, sort=False
          )
          # Rename comment_text to text for the act dict
          total_data.rename(
              columns={"comment_text": "text"}, inplace=True
          )
  
          # Use the different categories to get binary classification
          total_data["sensitive"] = (
              total_data["severe_toxic"]
              + total_data["toxic"]
              + total_data["obscene"]
              + total_data["threat"]
              + total_data["insult"]
              + total_data["identity_hate"]
          )
  
          total_data.loc[
              total_data["sensitive"] < 1, "is_sensitive"
          ] = 0
          total_data.loc[
              total_data["sensitive"] >= 1, "is_sensitive"
          ] = 1
  
          # Drop unnecessary column
          total_data = total_data.drop(columns=["id"])
  
          self.data_to_json(
              total_data, "wiki-toxic-comments-default.json"
          )
  
          # Partition 80/10/10 according to arXiv:1811.12900 [cs.CL]
          # 90 train 10 test in paper
          # split based on command line flag
          original_train = total_data[
              (total_data["data_type"] == "valid")
              | (total_data["data_type"] == "train")
          ].copy()
          l_td = len(original_train)
  
          original_train.iloc[: int(0.8 * l_td)]["data_type"] = "train"
          original_train.iloc[int(0.8 * l_td) : int(0.9 * l_td)][
              "data_type"
          ] = "test"
          original_train.iloc[int(0.9 * l_td) :]["data_type"] = "valid"
  
          self.data_to_json(
              original_train, "wiki-toxic-comments-partition.json"
          )
  
          # Merge the 3 files to get a list of dicts as follows:
          # [
          #     {
          #         'toxic': 0 or 1 ,
          #         'severe_toxic': 0 or 1,
          #         'obscene': 0 or 1,
          #         'threat': 0 or 1,
          #         'insult': 0 or 1,
          #         'identity_hate': 0 or 1,
          #         'text': <comments>,
          #         'data_type': test/validation/train,
          #         'sensitive': 0.0,
          #         'is_sensitive': 0/1
          #     },
          #   ...
          # ]
  
          build_data.mark_done(self.data_path, version)
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import parlai.core.build_data
  from parlai.core.message import Message
  from parlai.core.teachers import FixedDialogTeacher
  from parlai.utils.io import PathManager
  from .base_agent import _BaseSafetyTeacher
  from .build import build
  import copy
  import json
  import os
  import random
  import sys
label_desc: Use image node_id 5 for calling the WikiToxicCommentsTeacher obj's underlying member method code with example usage: obj.build(opt) without return types