code: def read_alt_treebank(constituency_input_dir):
      """
      Read the splits, read the trees, and split the trees based on the split descriptions
  
      Trees in ALT are:
        <tree id> <tree brackets>
      The tree id will look like
        SNT.<url_id>.<line>
      All we care about from this id is the url_id, which we crossreference in the splits
      to figure out which split the tree is in.
  
      The tree itself we don't process much, although we do convert it to a ParseTree
  
      The result is three lists: train, dev, test trees
      """
      train_split, dev_split, test_split = read_dataset_splits(
          constituency_input_dir
      )
  
      datafile = os.path.join(
          constituency_input_dir,
          "myanmar",
          "my_alt",
          "my-alt-190530",
          "data",
      )
      print("Reading trees from %s" % datafile)
      with open(datafile) as fin:
          tree_lines = fin.readlines()
  
      train_trees = []
      dev_trees = []
      test_trees = []
  
      for idx, tree_line in enumerate(tree_lines):
          tree_line = tree_line.strip()
          if not tree_line:
              continue
          dataset, tree_text = tree_line.split(maxsplit=1)
          dataset = dataset.split(".", 2)[1]
  
          trees = read_trees(tree_text)
          if len(trees) != 1:
              raise ValueError(
                  "Unexpected number of trees in line %d: %d"
                  % (idx, len(trees))
              )
          tree = trees[0]
  
          if dataset in train_split:
              train_trees.append(tree)
          elif dataset in dev_split:
              dev_trees.append(tree)
          elif dataset in test_split:
              test_trees.append(tree)
          else:
              raise ValueError(
                  "Could not figure out which split line %d belongs to"
                  % idx
              )
  
      return train_trees, dev_trees, test_trees
  
file_path: stanza/stanza/utils/datasets/tokenization/convert_my_alt.py
imports: import os
  import random
  from stanza.models.constituency.tree_reader import read_trees
label_desc: Use image node_id 3 for calling a global function with example usage: read_alt_treebank(constituency_input_dir) and returns: train_trees,  dev_trees,  test_trees