class_docstr: Wikipedia gender.
class_docstr_tok: ["Wikipedia","gender","."]
code: def __init__(self, opt, shared=None):
      if shared is None:
          # set map
          self.opt = opt
          self._set_chunk_idx_to_file(opt)
      else:
          self.chunk_idx_to_file = shared["chunk_idx_to_file"]
  
      self.class_task = opt["class_task"]
      self.is_train = (
          "train" in opt["datatype"]
          and "evalmode" not in opt["datatype"]
      )
      self.is_valid = "valid" in opt["datatype"]
      self.add_unknown_classes = (
          opt["add_unknown_classes"]
          and self.is_train
          and self.class_task == "all"
      )
  
      if self.class_task == "all":
          self.label_candidates = gend_utils.ALL_CANDS
      elif self.class_task == "single":
          self.label_candidates = {
              "about": [
                  gend_utils.FEM,
                  gend_utils.MASC,
                  gend_utils.NEUTRAL,
                  gend_utils.NONBINARY,
              ]
          }
  
      self.mask_gendered_words = opt["mask_gendered_words"]
      if self.mask_gendered_words:
          male, female = gend_utils.get_explicitly_gendered_words(
              self.opt
          )
          self.gendered_list = male + female
  
      self.counts = {
          gend_utils.FEM: 0,
          gend_utils.MASC: 0,
          gend_utils.NEUTRAL: 0,
          gend_utils.NONBINARY: 0,
      }
      super().__init__(opt, shared)
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.core.teachers import ChunkTeacher
  from parlai.tasks.wikipedia.build import build
  from parlai.utils.misc import warn_once
  import parlai.tasks.md_gender.utils
  from copy import deepcopy
  import json
  import os
  import random
  import re
  import spacy
  from typing import List
label_desc: Use image node_id 2 to create a new WikipediaTeacher object from inherited base classes: ChunkTeacher with example: obj = WikipediaTeacher(opt, shared)