def _load_pretrained_vocab(name, root=os.path.join(get_home_dir(), '<STR_LIT>'), cls=None):
file_name = '<STR_LIT>'.format(name=name,<EOL>short_hash=short_hash(name))<EOL>root = os.path.expanduser(root)<EOL>file_path = os.path.join(root, file_name + '<STR_LIT>')<EOL>sha1_hash = _vocab_sha1[name]<EOL>if os.path.exists(file_path):<EOL><INDENT>if check_sha1(file_path, sha1_hash):<EOL><INDENT>return _load_vocab_file(file_path, cls)<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>if not os.path.exists(root):<EOL><INDENT>os.makedirs(root)<EOL><DEDENT>zip_file_path = os.path.join(root, file_name + '<STR_LIT>')<EOL>repo_url = _get_repo_url()<EOL>if repo_url[-<NUM_LIT:1>] != '<STR_LIT:/>':<EOL><INDENT>repo_url = repo_url + '<STR_LIT:/>'<EOL><DEDENT>download(_url_format.format(repo_url=repo_url, file_name=file_name),<EOL>path=zip_file_path,<EOL>overwrite=True)<EOL>with zipfile.ZipFile(zip_file_path) as zf:<EOL><INDENT>zf.extractall(root)<EOL><DEDENT>os.remove(zip_file_path)<EOL>if check_sha1(file_path, sha1_hash):<EOL><INDENT>return _load_vocab_file(file_path, cls)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>
Load the accompanying vocabulary object for pre-trained model.

    Parameters
    ----------
    name : str
        Name of the vocabulary, usually the name of the dataset.
    root : str, default '$MXNET_HOME/models'
        Location for keeping the model parameters.
        MXNET_HOME defaults to '~/.mxnet'.
    cls : nlp.Vocab or nlp.vocab.BERTVocab, default nlp.Vocab

    Returns
    -------
    Vocab or nlp.vocab.BERTVocab
        Loaded vocabulary object for the pre-trained model.