class_docstr: This teacher examines model responses and classifies whether the model responded as
  the correct character.
  
  Evaluation is entirely dependent on the classifier specified.
class_docstr_tok: ["This","teacher","examines","model","responses","and","classifies","whether","the","model","responded","as","the","correct","character",".","Evaluation","is","entirely","dependent","on","the","classifier","specified","."]
docstr: Compute RPA 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","RPA","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 RPA 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 not model_response or not model_response.get("text"):
          return
      self.context.append(teacher_action["text"])
      context = self.delimiter.join(self.context)
      characters = extract_characters(context)
      correct_character = characters["_self_name"]
      model_text = model_response["text"]
      classifier_act = self.classifier.classify(context, model_text)
      predicted_character = classifier_act["text"]
      correct_prediction = int(predicted_character == correct_character)
      self.metrics.add(
          "character_accuracy", AverageMetric(correct_prediction)
      )
      scores = F.softmax(classifier_act["sorted_scores"].float(), dim=0)
      if teacher_action["episode_done"]:
          self.context = []
      else:
          assert labels
          self.context.append(labels[0])
  
      return predicted_character == correct_character
  
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 4 for calling the ResponseClassifierTeacher obj's underlying member method code with example usage: obj.custom_evaluation(teacher_action, labels, model_response) and returns: unknown