code: def process_json_file(path):
      data = json.load(open(path, "r"))["utts"]
      for idx, value in data.items():
          idx = idx.split("_")[-1]
          tokens = takewhile(
              lambda x: x != "<eos>",
              value["output"][0]["rec_token"].split(" "),
          )
          txt = " ".join(tokens)
          print("{}\t{}".format(idx, txt))
  
      return None
  
file_path: espnet/egs/iwslt16/mt1/local/extract_recog_text.py
imports: import argparse
  import glob
  import json
  import os
  from itertools import takewhile
label_desc: Use image node_id 2 for calling a global function with example usage: process_json_file(path) and returns: None