code: def get_subtrees(input_file, *args):
      """
      Use the CoreNLP OutputSubtrees tool to convert the input file to a bunch of phrases
  
      Returns a list of the SentimentDatum namedtuple
      """
      # TODO: maybe can convert this to use the python tree?
      cmd = [
          "java",
          "edu.stanford.nlp.trees.OutputSubtrees",
          "-input",
          input_file,
      ]
      if len(args) > 0:
          cmd = cmd + list(args)
      print(" ".join(cmd))
      results = subprocess.run(
          cmd,
          check=True,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          encoding="utf-8",
      )
      lines = results.stdout.split("\n")
      lines = [x.strip() for x in lines]
      lines = [x for x in lines if x]
      lines = [x.split(maxsplit=1) for x in lines]
      phrases = [SentimentDatum(x[0], x[1].split()) for x in lines]
      return phrases
  
file_path: stanza/stanza/utils/datasets/sentiment/process_sst.py
imports: import argparse
  import os
  import subprocess
  from stanza.models.classifiers.data import SentimentDatum
  import stanza.utils.datasets.sentiment.process_utils
  import stanza.utils.default_paths
label_desc: Use image node_id 1 for calling a global function with example usage: get_subtrees(input_file) and returns: phrases