code: def process_dataset(short_name, ontonotes_path, coref_output_path):
      try:
          from datasets import load_dataset
      except ImportError as e:
          raise ImportError(
              "Please install the datasets package to process OntoNotes coref with Stanza"
          )
  
      if short_name == "en_ontonotes":
          config_name = "english_v4"
      elif short_name in ("zh_ontonotes", "zh-hans_ontonotes"):
          config_name = "chinese_v4"
      elif short_name == "ar_ontonotes":
          config_name = "arabic_v4"
      else:
          raise ValueError(
              "Unknown short name for downloading ontonotes: %s"
              % short_name
          )
  
      pipe = stanza.Pipeline(
          "en",
          processors="tokenize,pos,lemma,depparse",
          package="default_accurate",
          tokenize_pretokenized=True,
      )
      dataset = load_dataset(
          "conll2012_ontonotesv5", config_name, cache_dir=ontonotes_path
      )
      for section, hf_name in SECTION_NAMES.items():
          # for section, hf_name in [("test", "test")]:
          print("Processing %s" % section)
          converted_section = convert_dataset_section(
              pipe, dataset[hf_name]
          )
          output_filename = os.path.join(
              coref_output_path, "%s.%s.json" % (short_name, section)
          )
          with open(output_filename, "w", encoding="utf-8") as fout:
              json.dump(converted_section, fout, indent=2)
  
file_path: stanza/stanza/utils/datasets/coref/convert_ontonotes.py
imports: from collections import defaultdict
  from functools import lru_cache
  import json
  import os
  import stanza
  from stanza.models.constituency import tree_reader
  from stanza.utils.default_paths import get_default_paths
  from stanza.utils.get_tqdm import get_tqdm
label_desc: Use image node_id 4 for calling a global function with example usage: process_dataset(short_name, ontonotes_path, coref_output_path) without return types