code: def generate_entity_file(
      line_arr, output_file="result_test.json", token_type_bpe=True
  ):
      fp = open(output_file, "w")
      for line in line_arr:
          scenario = line.strip().split("\t")[0].split("_")[0]
          action = "_".join(
              line.strip().split("\t")[0].split()[0].split("_")[1:]
          )
          if not token_type_bpe:
              line = line.replace(" ", "▁")
          entity_names_arr = line.strip().split("▁SEP")[1:-1]
          ent_final_arr = []
          for entity in entity_names_arr:
              if len(entity.split("▁FILL")) != 2:
                  continue
              ent_type = entity.split("▁FILL")[0].strip()
              if not token_type_bpe:
                  ent_type = ent_type.replace("▁", " ").strip()
              ent_val = (
                  entity.split("▁FILL")[1].strip().replace(" ", "")
              )
              ent_val = (
                  ent_val.replace("▁", " ").strip().replace("'", "'")
              )
              dict1 = {}
              dict1["type"] = ent_type
              dict1["filler"] = ent_val
              ent_final_arr.append(dict1)
          file_name = (
              line.strip()
              .split("\t")[1]
              .split("_")[-1]
              .replace(")", "")
          )
          file_name = "audio-" + file_name + ".flac"
          write_dict = {}
          write_dict["text"] = ""
          write_dict["scenario"] = scenario
          write_dict["action"] = action
          write_dict["entities"] = ent_final_arr
          write_dict["file"] = file_name
          json.dump(write_dict, fp)
          fp.write("\n")
  
imports: import argparse
  import json
  import os
  import sys
  from espnet2.utils.types import str2bool
label_desc: Use image node_id 1 for calling a global function with example usage: generate_entity_file(line_arr, output_file, token_type_bpe) without return types