class_docstr: Speaker Classifier Teacher.
  
  This teacher is used for the RPA classifier training.
  
  This teacher should NOT be used directly.
class_docstr_tok: ["Speaker","Classifier","Teacher",".","This","teacher","is","used","for","the","RPA","classifier","training",".","This","teacher","should","NOT","be","used","directly","."]
docstr: Ensure that certain opt parameters are set correctly.
docstr_tok: ["Ensure","that","certain","opt","parameters","are","set","correctly","."]
code: def __init__(self, opt, shared=None):
      """
      Ensure that certain opt parameters are set correctly.
      """
      if opt["annotate_speaker"]:
          assert opt[
              "light_use_person_names"
          ], "must set --light_use_person_names True if annotating speaker"
      self.annotate_speaker = opt["annotate_speaker"]
      self.speaker_annotation_position = opt[
          "speaker_annotation_position"
      ]
      self.speaker_label_type = opt["speaker_label_type"]
      self.classifier_label_type = opt["classifier_label_type"]
      self.speaker_separator = opt["speaker_separator"]
      self.include_light_context = opt["include_light_context"]
      self.num_utterances = opt["num_utterances"]
      self.inline_candidate_type = opt["inline_candidate_type"]
      self.num_train_inline_candidates = opt[
          "num_train_inline_candidates"
      ]
      self.delimiter = opt.get("delimiter", DEFAULT_DELIM)
      self.use_speech_prefix = opt["light_use_speech_prefix"]
      self.left_to_right = opt["left_to_right"]
      self.delimit_label_control = opt["delimit_label_control"]
      if opt.get("exclude_from_context"):
          self.exclude_from_context = opt["exclude_from_context"].split(
              opt["exclude_from_context_delimiter"]
          )
      else:
          self.exclude_from_context = []
      assert all(c in CONTEXT_KEYS for c in self.exclude_from_context)
      # manually set persona to all
      opt["light_use_persona"] = "all"
      super().__init__(opt, shared)
  
imports: from abc import ABC
  from collections import deque
  import re
  from typing import Optional
  from parlai.core.build_data import modelzoo_path
  from parlai.core.message import Message
  from parlai.core.metrics import AverageMetric
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.tasks.light_dialog.agents import SimpleMultiTeacher
  from parlai.utils.data import DatatypeHelper
  import parlai.utils.logging
  import copy
  import os
  import random
  import torch
  import torch.nn
  import torch.nn.functional
  from typing import List, Dict, Tuple
  from projects.light_whoami.task.utils import DEFAULT_DELIM, CONTEXT_KEYS, extract_characters, WHO_AM_I, WHO_ARE_YOU, SELF, PARTNER, WHO_IS_THIS, maybe_annotate
  import projects.light_whoami.task.mutators
label_desc: Use image node_id 3 to create a new SpeakerClassifierTeacher object from inherited base classes: SimpleMultiTeacher, ABC with example: obj = SpeakerClassifierTeacher(opt, shared)