code: def vocab_from_json(path: str, encoding: str = C.VOCAB_ENCODING) -> Vocab:
      
      with open(path, encoding=encoding) as inp:
          vocab = json.load(inp)
          utils.check_condition(is_valid_vocab(vocab), "Vocabulary %s not valid." % path)
          logger.info('Vocabulary (%d words) loaded from "%s"', len(vocab), path)
          return vocab
docs: Saves vocabulary in json format.
  
      :param path: Path to json file containing the vocabulary.
      :param encoding: Vocabulary encoding.
      :return: The loaded vocabulary.