code: def process_treebank(treebank, model_type, paths, output_dir):
      with tempfile.TemporaryDirectory() as tokenizer_dir:
          paths = dict(paths)
          paths["TOKENIZE_DATA_DIR"] = tokenizer_dir
  
          short_name = treebank_to_short_name(treebank)
  
          # first we process the tokenization data
          args = argparse.Namespace()
          args.augment = False
          args.prepare_labels = False
          prepare_tokenizer_treebank.process_treebank(
              treebank, model_type, paths, args
          )
  
          # TODO: these names should be refactored
          train_file = f"{tokenizer_dir}/{short_name}.train.gold.conllu"
          dev_file = f"{tokenizer_dir}/{short_name}.dev.gold.conllu"
          test_file = f"{tokenizer_dir}/{short_name}.test.gold.conllu"
  
          train_set = common.read_sentences_from_conllu(train_file)
          dev_set = common.read_sentences_from_conllu(dev_file)
          test_set = common.read_sentences_from_conllu(test_file)
  
          train_out = os.path.join(
              output_dir, f"{short_name}.train.seg.txt"
          )
          test_out = os.path.join(
              output_dir, f"{short_name}.test.seg.txt"
          )
  
          write_segmenter_file(train_out, train_set + dev_set)
          write_segmenter_file(test_out, test_set)
  
file_path: stanza/stanza/utils/datasets/corenlp_segmenter_dataset.py
imports: import argparse
  import os
  import sys
  import tempfile
  import stanza.utils.datasets.common
  import stanza.utils.datasets.prepare_tokenizer_treebank
  import stanza.utils.default_paths
  from stanza.models.common.constant import treebank_to_short_name
label_desc: Use image node_id 3 for calling a global function with example usage: process_treebank(treebank, model_type, paths, output_dir) without return types