docstr: Special vocab which is not really vocabulary but instead a class
  which returns embedding pre-extracted from files. Can be used load
  word embeddings from popular models like ELMo and BERT
  
  
  Parameters
  ----------
  base_path: str
      path containing saved files with embeddings one file per txt item
docstr_tok: ["Special","vocab","which","is","not","really","vocabulary","but","instead","a","class","which","returns","embedding","pre-extracted","from","files",".","Can","be","used","load","word","embeddings","from","popular","models","like","ELMo","and","BERT","Parameters","--","--","--","--","--","base_path",":","str","path","containing","saved","files","with","embeddings","one","file","per","txt","item"]
code: def __init__(self, base_path, emb_dim, *args, **kwargs):
      """Special vocab which is not really vocabulary but instead a class
      which returns embedding pre-extracted from files. Can be used load
      word embeddings from popular models like ELMo and BERT
  
  
      Parameters
      ----------
      base_path: str
          path containing saved files with embeddings one file per txt item
      """
      super().__init__(*args, **kwargs)
      self.type = "extracted"
      self.emb_dim = emb_dim
      self.base_path = base_path
  
imports: import logging
  import os
  from collections import defaultdict
  import numpy
  import torch
  from mmf.utils.configuration import get_mmf_cache_dir
  from mmf.utils.distributed import is_main, synchronize
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path
  from torchtext import vocab
label_desc: Use image node_id 1 to create a new ExtractedVocab object from inherited base classes: BaseVocab with example: obj = ExtractedVocab(base_path, emb_dim)