code: def get_label_name_tree(
      label_name_list, tokenizer, end_symbol="<end>"
  ):
      sub_token_tree = dict()
  
      label_tree = dict()
      for typename in label_name_list:
          after_tokenized = tokenizer.encode(
              typename, add_special_tokens=False
          )
          # label_tree[typename] = tokenizer.convert_ids_to_tokens(after_tokenized)
          label_tree[typename] = after_tokenized
  
      for _, sub_label_seq in label_tree.items():
          parent = sub_token_tree
          for value in sub_label_seq:
              if value not in parent:
                  parent[value] = dict()
              parent = parent[value]
  
          parent[end_symbol] = None
  
      return sub_token_tree
  
imports: from typing import Dict
label_desc: Use image node_id 3 for calling a global function with example usage: get_label_name_tree(label_name_list, tokenizer, end_symbol) and returns: sub_token_tree