class_docstr: Evaluator class for calculating SLURP metrics
code: def __init__(self, average_mode: str = "micro") -> None:
      if average_mode not in ["micro", "macro"]:
          raise ValueError(
              f"Only supports 'micro' or 'macro' average, but got {average_mode} instead."
          )
      self.average_mode = average_mode
      self.scenario_f1 = ErrorMetric.get_instance(
          metric="f1", average=average_mode
      )
      self.action_f1 = ErrorMetric.get_instance(
          metric="f1", average=average_mode
      )
      self.intent_f1 = ErrorMetric.get_instance(
          metric="f1", average=average_mode
      )
      self.span_f1 = ErrorMetric.get_instance(
          metric="span_f1", average=average_mode
      )
      self.distance_metrics = {}
      for distance in ["word", "char"]:
          self.distance_metrics[distance] = ErrorMetric.get_instance(
              metric="span_distance_f1",
              average=average_mode,
              distance=distance,
          )
      self.slu_f1 = ErrorMetric.get_instance(
          metric="slu_f1", average=average_mode
      )
      self.invalid = 0
      self.total = 0
  
file_path: NeMo/examples/slu/speech_intent_slot/eval_utils/evaluator.py
imports: import ast
  from typing import Dict, List, Tuple, Union
  from .evaluation.metrics.metrics import ErrorMetric
label_desc: Use image node_id 1 to create a new SLURPEvaluator object  with example: obj = SLURPEvaluator(average_mode)