code: def __init__(
      self,
      sentences,
      min_count=1,
      regex=SENTENCE_SPLIT_REGEX,
      keep=None,
      remove=None,
      only_unk_extra=False,
  ):
      if keep is None:
          keep = []
      if remove is None:
          remove = []
      token_counter = Counter()
  
      for sentence in sentences:
          tokens = tokenize(
              sentence, regex=regex, keep=keep, remove=remove
          )
          token_counter.update(tokens)
  
      token_list = []
      for token in token_counter:
          if token_counter[token] >= min_count:
              token_list.append(token)
  
      extras = self.DEFAULT_TOKENS
  
      if only_unk_extra:
          extras = [self.UNK_TOKEN]
  
      self.word_list = extras + token_list
      self._build()
  
imports: import os
  import re
  from collections import Counter
  from itertools import chain
  import torch
  from mmf.common.registry import registry
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path
label_desc: Use image node_id 1 to create a new VocabFromText object from inherited base classes: VocabDict with example: obj = VocabFromText(sentences, min_count, regex, keep, remove, only_unk_extra)