code: def generate_vocab(
      train_path, raw_vocab_path, new_vocab_path, label_vocab_path
  ):
      f1 = open(new_vocab_path, "w")
      with open(raw_vocab_path, "r") as f:
          for idx, line in enumerate(f.readlines()):
              word = line.strip()
              if word == "[UNK]":
                  word = "<unk>"
              f1.write(word + "\t" + str(idx) + "\n")
      label_vocab_file = open(label_vocab_path, "w")
      label_vocab = {}
      with open(train_path, "r") as f:
          for line in f.readlines():
              labels = line.strip().split("\t")[0]
              for t in labels.split(" "):
                  if t in label_vocab:
                      label_vocab[t] += 1
                  else:
                      label_vocab[t] = 1
      label_vocab = sorted(
          label_vocab.items(), key=lambda x: x[1], reverse=True
      )
      idx = 0
      for label, count in label_vocab:
          label_vocab_file.write(label + "\t" + str(idx) + "\n")
          idx += 1
  
label_desc: Use image node_id 1 for calling a global function with example usage: generate_vocab(train_path, raw_vocab_path, new_vocab_path, label_vocab_path) without return types