class_docstr: CMU Document Grounded Conversations Dataset (aka CMU_DoG)
  
  Paper: https://arxiv.org/pdf/1809.07358.pdf
  Source: https://github.com/festvox/datasets-CMU_DoG
class_docstr_tok: ["CMU","Document","Grounded","Conversations","Dataset","(","aka","CMU_DoG",")","Paper",":","https",":","\/\/arxiv.org\/pdf\/1809.07358.pdf","Source",":","https",":","\/\/github.com\/festvox\/datasets-CMU_DoG"]
code: def custom_evaluation(
      self,
      teacher_action: Message,
      labels: Optional[Tuple[str]],
      model_response: Message,
  ):
      if (
          "text" in model_response
          and "checked_sentence" in teacher_action
      ):
          self.metrics.add(
              "knowledge_f1",
              F1Metric.compute(
                  model_response["text"],
                  [teacher_action["checked_sentence"]],
              ),
          )
      if "text" in model_response and labels:
          self.metrics.add(
              "rare_word_f1",
              self.rare_word_f1.compute(model_response["text"], labels),
          )
  
imports: import copy
  import json
  import os
  from enum import Enum
  from typing import List, Optional, Tuple
  from parlai.core.message import Message
  from parlai.core.metrics import F1Metric
  from parlai.core.mutators import EpisodeMutator, MessageMutator, register_mutator
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.teachers import DialogTeacher
  from parlai.tasks.cmu_dog.build import build
  from parlai.tasks.wizard_of_wikipedia.agents import RareWordF1Calculator, TOKEN_KNOWLEDGE, TOKEN_END_KNOWLEDGE
  from parlai.utils.data import DatatypeHelper
  from parlai.utils.io import PathManager
  from parlai.utils.logging import logger
  from parlai.utils.typing import TShared
label_desc: Use image node_id 5 for calling the CMUDocumentGroundedConversationsTeacher obj's underlying member method code with example usage: obj.custom_evaluation(teacher_action, labels, model_response) without return types