class_docstr: Teacher for the SummaryQA dataset.
code: def custom_evaluation(
      self, teacher_action: Message, labels, model_response: Message
  ):
      if "text" in model_response and model_response["text"]:
          normalized_response = normalize_answer(model_response["text"])
  
          if labels:
              normalized_labels = [normalize_answer(a) for a in labels]
              self.metrics.add(
                  "norm_f1",
                  F1Metric.compute(
                      normalized_response, normalized_labels
                  ),
              )
              self.metrics.add(
                  "norm_em",
                  AverageMetric(
                      int(normalized_response in normalized_labels)
                  ),
              )
              self.metrics.add(
                  "kaa",
                  AverageMetric(
                      int(
                          any(
                              [
                                  l in normalized_response
                                  for l in normalized_labels
                              ]
                          )
                      )
                  ),
              )
  
              if "knowledge_response" in model_response:
                  # Is the predicted knowledge response in the dialogue response?
                  self.metrics.add(
                      "pkaa",
                      AverageMetric(
                          int(
                              normalize_answer(
                                  model_response["knowledge_response"]
                              )
                              in normalized_response
                          )
                      ),
                  )
  
file_path: ParlAI/projects/k2r/lightqa/task/agents.py
imports: import json
  import os
  from parlai.core.teachers import DialogTeacher
  from parlai.utils.io import PathManager
  from parlai.core.message import Message
  from parlai.core.metrics import F1Metric, normalize_answer, AverageMetric
  from .build import build
label_desc: Use image node_id 3 for calling the SummaryQATeacher obj's underlying member method code with example usage: obj.custom_evaluation(teacher_action, labels, model_response) without return types