class_docstr: Generaes the utterances for a single character only.
  
  The label will be the silent token if that character doesn't speak that round. This
  is an abstract class: do NOT use directly!
class_docstr_tok: ["Generaes","the","utterances","for","a","single","character","only",".","The","label","will","be","the","silent","token","if","that","character","does","n't","speak","that","round",".","This","is","an","abstract","class",":","do","NOT","use","directly","!"]
code: def custom_evaluation(
      self,
      teacher_action: Message,
      labels: Optional[Tuple[str]],
      model_response: Message,
  ) -> None:
      if model_response.is_padding() or (
          not model_response.get("text", None)
      ):
          return
  
      model_predicted_speak = str(
          self.silence_token not in model_response["text"]
      )
      label_was_speak = str(self.silence_token not in labels[0])
      self.metrics.add(
          "self_speaker_acc",
          ExactMatchMetric.compute(
              model_predicted_speak, [label_was_speak]
          ),
      )
      # Precited speaker confusion metrics
      precision, recall, f1 = ConfusionMatrixMetric.compute_metrics(
          [model_predicted_speak], [label_was_speak], "True"
      )
      self.metrics.add("self_speaker_precision", precision[0])
      self.metrics.add("self_speaker_recall", recall[0])
      self.metrics.add("self_speaker_f1", f1[0])
  
imports: from abc import ABC, abstractclassmethod
  import copy
  import jsonlines
  import random
  import os
  from typing import Any, Dict, List, Optional, Set, Tuple
  from parlai.core.message import Message
  from parlai.core.metrics import ExactMatchMetric, F1Metric
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.teachers import DialogTeacher
  from parlai.core.torch_classifier_agent import ConfusionMatrixMetric
  from parlai.utils.data import DatatypeHelper
  from parlai.tasks.light_multiparty.build import build, DATASET_NAME
label_desc: Use image node_id 7 for calling the SingleSpeakerTeacher obj's underlying member method code with example usage: obj.custom_evaluation(teacher_action, labels, model_response) without return types