code: def convert_tag_vocab(state_dict):
      if state_dict["lower"]:
          raise AssertionError(
              "Did not expect an NER vocab with 'lower' set to True"
          )
      items = state_dict["_id2unit"][len(VOCAB_PREFIX) :]
      # this looks silly, but the vocab builder treats this as words with multiple fields
      # (we set it to look for field 0 with idx=0)
      # and then the label field is expected to be a list or tuple of items
      items = [[[[x]]] for x in items]
      vocab = CompositeVocab(
          data=items, lang=state_dict["lang"], idx=0, sep=None
      )
      if len(vocab._id2unit[0]) != len(state_dict["_id2unit"]):
          raise AssertionError(
              "Failed to construct a new vocab of the same length as the original"
          )
      if vocab._id2unit[0] != state_dict["_id2unit"]:
          raise AssertionError(
              "Failed to construct a new vocab in the same order as the original"
          )
      return vocab
  
file_path: stanza/stanza/models/ner/vocab.py
imports: from collections import Counter, OrderedDict
  from stanza.models.common.vocab import BaseVocab, BaseMultiVocab, CharVocab, CompositeVocab
  from stanza.models.common.vocab import VOCAB_PREFIX
  from stanza.models.common.pretrain import PretrainedWordVocab
  from stanza.models.pos.vocab import WordVocab
label_desc: Use image node_id 1 for calling a global function with example usage: convert_tag_vocab(state_dict) and returns: vocab