class_docstr: Base class for all fields that need to build a vocabulary.
class_docstr_tok: ["Base","class","for","all","fields","that","need","to","build","a","vocabulary","."]
code: def __init__(
      self,
      pretrained_embeddings_path="",
      embed_dim=0,
      embedding_init_strategy=EmbedInitStrategy.RANDOM,
      vocab_file="",
      vocab_size="",
      vocab_from_train_data=True,  # add tokens from train data to vocab
      vocab_from_all_data=False,  # add tokens from train, eval, test data to vocab
      # add tokens from pretrained embeddings to vocab
      vocab_from_pretrained_embeddings=False,
      min_freq=1,
      *args,
      **kwargs,
  ):
      super().__init__(*args, **kwargs)
      self.pretrained_embeddings_path = pretrained_embeddings_path
      self.vocab_file = vocab_file
      self.vocab_size = vocab_size
      self.vocab_from_train_data = vocab_from_train_data
      self.vocab_from_all_data = vocab_from_all_data
      self.vocab_from_pretrained_embeddings = (
          vocab_from_pretrained_embeddings
      )
      self.min_freq = min_freq
      self.embed_dim = embed_dim
      self.embedding_init_strategy = embedding_init_strategy
  
imports: import re
  from typing import Any, Dict, Tuple, Union
  import torch
  from pytext.common.constants import Padding, VocabMeta
  from pytext.legacy import data
  from pytext.legacy.vocab import Vocab
  from pytext.utils import data, precision
  from pytorch.text.fb.utils.config_utils import EmbedInitStrategy
label_desc: Use image node_id 1 to create a new VocabUsingField object from inherited base classes: Field with example: obj = VocabUsingField(pretrained_embeddings_path, embed_dim, embedding_init_strategy, vocab_file, vocab_size, vocab_from_train_data, vocab_from_all_data, vocab_from_pretrained_embeddings, min_freq)