code: def convert_wikihomograph_data_to_manifest(
      data_folder: str, output_manifest: str
  ):
      """
      Convert WikiHomograph data to .json manifest
  
      Args:
          data_folder: data_folder that contains .tsv files
          output_manifest: path to output file
      """
      with open(output_manifest, "w") as f_out:
          for file in tqdm(glob(f"{data_folder}/*.tsv")):
              (
                  sentences,
                  start_end_indices,
                  heteronyms,
                  word_ids,
              ) = read_wikihomograph_file(file)
              for i, sent in enumerate(sentences):
                  start, end = start_end_indices[i]
                  heteronym_span = sent[start:end]
                  entry = {
                      "text_graphemes": sent,
                      "start_end": [start, end],
                      "heteronym_span": heteronym_span,
                      "word_id": word_ids[i],
                  }
                  f_out.write(
                      json.dumps(entry, ensure_ascii=False) + "\n"
                  )
      print(f"Data saved at {output_manifest}")
  
file_path: NeMo/scripts/dataset_processing/g2p/export_wikihomograph_data_to_manifest.py
imports: import csv
  import json
  from argparse import ArgumentParser
  from glob import glob
  from typing import List, Tuple
  from tqdm import tqdm
label_desc: Use image node_id 4 for calling a global function with example usage: convert_wikihomograph_data_to_manifest(data_folder, output_manifest) without return types