code: def get_results(result_file, result_key):
      re_id = r"^id: "
      re_strings = {
          "Speaker": r"^Speaker sentences",
          "Scores": r"^Scores: ",
          "REF": r"^REF: ",
          "HYP": r"^HYP: ",
      }
      re_id = re.compile(re_id)
      re_patterns = {}
      for p in re_strings.keys():
          re_patterns[p] = re.compile(re_strings[p])
  
      results = {}
      tmp_id = None
      tmp_ret = {}
  
      with codecs.open(result_file, "r", encoding="utf-8") as f:
          line = f.readline()
          while line:
              x = line.rstrip()
              x_split = x.split()
  
              if re_id.match(x):
                  if tmp_id:
                      results[tmp_id] = {result_key: tmp_ret}
                      tmp_ret = {}
                  tmp_id = x_split[1]
              for p in re_patterns.keys():
                  if re_patterns[p].match(x):
                      tmp_ret[p] = " ".join(x_split[1:])
              line = f.readline()
  
      if tmp_ret != {}:
          results[tmp_id] = {result_key: tmp_ret}
  
      return {"utts": results}
  
file_path: espnet/utils/eval_perm_free_error.py
imports: import argparse
  import codecs
  import json
  import logging
  import re
  import sys
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: get_results(result_file, result_key) and returns: dict