code: def custom_evaluation(
      self,
      teacher_action: Message,
      labels: Optional[Tuple[str]],
      model_response: Message,
  ) -> None:
      model_response = Message(model_response)
      if model_response.is_padding() or (
          not model_response.get("text", None)
      ):
          return
  
      # Finding speaker label accuracy, only if it was included in the teacher labels
      if self.include_speaker_in_label:
          resp = model_response.get("text")
          parts = resp.split(self.speaker_token_delimiter)
  
          # If model predicts a speaker label, there should be at leat two parts separted by ':'
          if len(parts) >= 2:
              predited_speaker = parts[0].strip()
          else:
              # A dummy string to trigger this as the wrong speaker.
              predited_speaker = "__NO_SPEAKER__"
  
          # The teacher will always include the correct speaker label in the 'speaker' field
          expected_speaker = teacher_action.get("speaker")
          # Predicted speaker accuracy
          self.metrics.add(
              "speaker_acc",
              ExactMatchMetric.compute(
                  predited_speaker, [expected_speaker]
              ),
          )
  
          # unigram F1 Metric for the speech part only, removing the speaker token
          speech_text = parts[-1]
          label_speech_text = labels[0].split(
              self.speaker_token_delimiter
          )[-1]
          self.metrics.add(
              "speech_f1",
              F1Metric.compute(speech_text, [label_speech_text]),
          )
  
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 3 for calling the AllSpeakersTeacher obj's underlying member method code with example usage: obj.custom_evaluation(teacher_action, labels, model_response) without return types