code: def get_slot_tagging_f1(frame_ref, frame_hyp, utt, service):
      """Get slot tagging (non-categorical slots only) F1 scores of a frame.
  
      Args:
        frame_ref: single semantic frame from reference (ground truth) file.
        frame_hyp: single semantic frame from hypothesis (prediction) file.
        utt: user utterance. Slot tagging annotations are the character positions in
          the utterance.
        service: a service data structure in the schema. We use it to infer whether
          a slot is non-categorical.
  
      Returns:
        A F1Scores object containing F1, precision, and recall scores.
      """
      list_noncat_slots = [
          s["name"] for s in service["slots"] if not s["is_categorical"]
      ]
      if "slots" not in frame_hyp:
          return None
      else:
          list_ref = [
              (s["slot"], utt[s["start"] : s["exclusive_end"]])
              for s in frame_ref["slots"]
              if s["slot"] in list_noncat_slots
          ]
          list_hyp = [
              (s["slot"], utt[s["start"] : s["exclusive_end"]])
              for s in frame_hyp["slots"]
              if s["slot"] in list_noncat_slots
          ]
          return compute_f1(list_ref, list_hyp)
  
file_path: NeMo/nemo/collections/nlp/metrics/sgd_metrics.py
imports: import collections
  import numpy
  from rapidfuzz import fuzz
label_desc: Use image node_id 6 for calling a global function with example usage: get_slot_tagging_f1(frame_ref, frame_hyp, utt, service) and returns: None, compute_f1