code: def tree_printer(sentence: Sentence, tag_type: str):
      tree: List[NodeToken] = [
          NodeToken(token, tag_type) for token in sentence
      ]
      for x in tree:
          if x.token.head_id != 0:
              head_token = x.token.get_head()
  
              for y in tree:
                  if y.token == head_token:
                      x.set_haed(y)
          else:
              root_node = x
      print_tree(root_node, "children")
  
file_path: flair/flair/visual/tree_printer.py
imports: from typing import List
  from pptree import print_tree
  from flair.data import Sentence, Token
label_desc: Use image node_id 1 for calling a global function with example usage: tree_printer(sentence, tag_type) without return types