code: def dataset_vocab(dataset):
      vocab = set()
      for line in dataset:
          for word in line.text:
              vocab.add(word)
      vocab = [PAD, UNK] + list(vocab)
      if vocab[PAD_ID] != PAD or vocab[UNK_ID] != UNK:
          raise ValueError("Unexpected values for PAD and UNK!")
      return vocab
  
imports: import collections
  from collections import namedtuple
  import logging
  import json
  import random
  import re
  from typing import List
  from stanza.models.classifiers.utils import WVType
  from stanza.models.common.vocab import PAD, PAD_ID, UNK, UNK_ID
  import stanza.models.constituency.tree_reader
label_desc: Use image node_id 4 for calling a global function with example usage: dataset_vocab(dataset) and returns: vocab