code: def create_vocabs(
      train_path,
      dev_path,
      test_path,
      normalize_digits=True,
      min_occur=1,
      glove_dict=None,
  ):
      word_vocab = defaultdict(lambda: len(word_vocab))
      word_count = defaultdict(lambda: 0)
      char_vocab = defaultdict(lambda: len(char_vocab))
      ner_vocab = defaultdict(lambda: len(ner_vocab))
  
      UNK_WORD = word_vocab["<unk>"]
      PAD_WORD = word_vocab["<pad>"]
      UNK_CHAR = char_vocab["<unk>"]
      PAD_CHAR = char_vocab["<pad>"]
      UNK_NER = ner_vocab["<unk>"]
      PAD_NER = ner_vocab["<pad>"]
  
      print("Creating Vocabularies:")
  
      for file_path in [train_path, dev_path, test_path]:
          with open(file_path, "r") as file:
              for line in file:
                  line = line.strip()
                  if len(line) == 0:
                      continue
  
                  tokens = line.split(" ")
                  for char in tokens[1]:
                      cid = char_vocab[char]
  
                  word = (
                      DIGIT_RE.sub("0", tokens[1])
                      if normalize_digits
                      else tokens[1]
                  )
                  ner = tokens[4]
  
                  if glove_dict is not None and (
                      word in glove_dict or word.lower() in glove_dict
                  ):
                      word_count[word] += min_occur + 1
                  elif file_path == train_path:
                      word_count[word] += 1
  
                  nid = ner_vocab[ner]
  
      print("Total Vocabulary Size: %d" % len(word_count))
      for word in word_count:
          if word_count[word] > min_occur:
              wid = word_vocab[word]
  
      print("Word Vocabulary Size: %d" % len(word_vocab))
      print("Character Alphabet Size: %d" % len(char_vocab))
      print("NER Alphabet Size: %d" % len(ner_vocab))
  
      word_vocab = defaultdict(lambda: UNK_WORD, word_vocab)
      char_vocab = defaultdict(lambda: UNK_CHAR, char_vocab)
      ner_vocab = defaultdict(lambda: UNK_NER, ner_vocab)
  
      i2w = {v: k for k, v in word_vocab.items()}
      i2n = {v: k for k, v in ner_vocab.items()}
      return (word_vocab, char_vocab, ner_vocab), (i2w, i2n)
  
imports: import re
  from collections import defaultdict
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: create_vocabs(train_path, dev_path, test_path, normalize_digits, min_occur, glove_dict) and returns: word_vocab,  char_vocab,  ner_vocab,  i2w,  i2n