class_docstr: Evaluator class for calculating SLURP metrics
code: def update(
      self,
      predictions: Union[List[str], str],
      groundtruth: Union[List[str], str],
  ) -> None:
      if isinstance(predictions, str):
          predictions = [predictions]
      if isinstance(groundtruth, str):
          groundtruth = [groundtruth]
  
      for pred, truth in zip(predictions, groundtruth):
          pred, syntax_error = parse_semantics_str2dict(pred)
          truth, _ = parse_semantics_str2dict(truth)
          self.scenario_f1(truth["scenario"], pred["scenario"])
          self.action_f1(truth["action"], pred["action"])
          self.intent_f1(
              f"{truth['scenario']}_{truth['action']}",
              f"{pred['scenario']}_{pred['action']}",
          )
          self.span_f1(truth["entities"], pred["entities"])
          for distance, metric in self.distance_metrics.items():
              metric(truth["entities"], pred["entities"])
  
          self.total += 1
          self.invalid += int(syntax_error)
  
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 3 for calling the SLURPEvaluator obj's underlying member method code with example usage: obj.update(predictions, groundtruth) without return types