docstr: Compute Classifier for a model response.
  
  :param teacher_action:
      The message last sent from this teacher.
  :param labels:
      The previous correct labels
  :param model_response:
      The raw response from the model
docstr_tok: ["Compute","Classifier","for","a","model","response",".",":","param","teacher_action",":","The","message","last","sent","from","this","teacher",".",":","param","labels",":","The","previous","correct","labels",":","param","model_response",":","The","raw","response","from","the","model"]
code: def custom_evaluation(
      self,
      teacher_action: Message,
      labels: Optional[Tuple[str]],
      model_response: Message,
  ) -> None:
      """
      Compute Classifier for a model response.
  
      :param teacher_action:
          The message last sent from this teacher.
      :param labels:
          The previous correct labels
      :param model_response:
          The raw response from the model
      """
      if self.classifier is None:
          return
      if not model_response or not model_response.get("text"):
          return
      self.context.append(teacher_action["text"])
      correct_class = self.classifier.ref_class
      model_text = model_response["text"]
      if self.truncate_prediction_at > 0:
          model_text = " ".join(
              model_text.split()[: self.truncate_prediction_at]
          )
  
      if self.include_label_cand_only:
          classifier_act = self.predict(model_text)
      else:
          context = self.delimiter.join(self.context)
          classifier_act = self.predict(
              context + self.delimiter + model_text
          )
  
      if "text" in classifier_act:
          predicted_class = classifier_act["text"]
          correct_prediction = int(predicted_class == correct_class)
  
          self.metrics.add(
              "classifier_accuracy", AverageMetric(correct_prediction)
          )
  
      if teacher_action["episode_done"]:
          self.context = []
      else:
          assert labels
          self.context.append(labels[0])
  
imports: from typing import List, Tuple
  from typing import Optional
  from parlai.core.agents import Agent, create_agent_from_model_file, create_agent_from_shared
  from parlai.core.params import ParlaiParser
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.mutators import register_mutator, ManyEpisodeMutator, EpisodeMutator
  import parlai.tasks.bot_adversarial_dialogue.agents
  import parlai.tasks.dialogue_safety.agents
  import parlai.utils.logging
  from parlai.core.metrics import AverageMetric
label_desc: Use image node_id 5 for calling the ClassifierMetricTeacher obj's underlying member method code with example usage: obj.custom_evaluation(teacher_action, labels, model_response) without return types