class_docstr: This Teacher is responsible for performing the task of Dialogue State Tracking. It
  can be used to evaluate LM on JGA (Joint Goal Accuracy) metric (as shown in.
  
  [SimpleTOD](https://arxiv.org/abs/2005.00796) and
  [Soloist](https://arxiv.org/abs/2005.05298)).
class_docstr_tok: ["This","Teacher","is","responsible","for","performing","the","task","of","Dialogue","State","Tracking",".","It","can","be","used","to","evaluate","LM","on","JGA","(","Joint","Goal","Accuracy",")","metric","(","as","shown","in",".","[","SimpleTOD","]","(","https",":","\/\/arxiv.org\/abs\/2005.00796",")","and","[","Soloist","]","(","https",":","\/\/arxiv.org\/abs\/2005.05298",")",")","."]
docstr: Adapted from https://github.com/google-research/google-research/blob/4b5b9ceb480
  f58fddb289618597187325e8540c3/schema_guided_dst/metrics.py#L245 Slot value is
  considered equal if they match exactly for categorical slots or if they fuzzy
  match for non categorical.
docstr_tok: ["Adapted","from","https",":","\/\/github.com\/google-research\/google-research\/blob\/4b5b9ceb480","f58fddb289618597187325e8540c3\/schema_guided_dst\/metrics.py","#","L245","Slot","value","is","considered","equal","if","they","match","exactly","for","categorical","slots","or","if","they","fuzzy","match","for","non","categorical","."]
code: def custom_evaluation(
      self, teacher_action: Message, labels, model_response: Message
  ):
      """
      Adapted from https://github.com/google-research/google-research/blob/4b5b9ceb480
      f58fddb289618597187325e8540c3/schema_guided_dst/metrics.py#L245 Slot value is
      considered equal if they match exactly for categorical slots or if they fuzzy
      match for non categorical.
      """
  
      gt_slots = teacher_action["slots"]
  
      predicted_slots = {}
      if model_response.get("text"):
          for slots in model_response["text"].split(
              self.SLOT_ENTRY_SEPARATOR
          ):
              if slots:
                  slot_info = slots.split(" ", maxsplit=1)
                  if len(slot_info) == 2:
                      slot_name, slot_val = slot_info
                      predicted_slots[slot_name] = slot_val
  
      all_slots_correct = True
  
      for service_slot in teacher_action["service"]["slots"]:
          are_slots_equal = self.compare_slot_values(
              gt_slots, predicted_slots, service_slot
          )
          all_slots_correct = all_slots_correct and are_slots_equal
          if service_slot["name"] in predicted_slots:
              self.metrics.add("slot_p", AverageMetric(are_slots_equal))
          if service_slot["name"] in gt_slots:
              self.metrics.add("slot_r", AverageMetric(are_slots_equal))
  
      self.metrics.add("jga", AverageMetric(all_slots_correct))
  
imports: import glob
  import json
  import os
  from typing import Any, Dict, List, Optional
  import parlai.tasks.google_sgd.build
  import parlai.core.tod.tod_core
  import parlai.core.tod.tod_agents
  from parlai.core.tod.tod_core import SerializationHelpers
  from parlai.core.message import Message
  from parlai.core.metrics import AverageMetric
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from fuzzywuzzy import fuzz
  from parlai.utils.io import PathManager
label_desc: Use image node_id 3 for calling the GoogleSGDDSTTeacher obj's underlying member method code with example usage: obj.custom_evaluation(teacher_action, labels, model_response) without return types