class_docstr: Vocab model builder.
  
  Parameters
  ----------
  data_set: iterable
      A list of instances where each instance is a list of str.
  tokenizer: function, optional
      Word tokenization function, default: ``nltk.tokenize.word_tokenize``.
  max_word_vocab_size: int, optional
      Maximal word vocab size, default: ``None``.
  min_word_vocab_freq: int, optional
      Minimal word vocab frequency, default: ``1``.
  pretrained_word_emb_name: str, optional, default="840B"
      The name of pretrained word embedding in ``torchtext``.
      If it is set ``None``, we will randomly set the initial word embedding values.
  pretrained_word_emb_url: str optional, default: ``None``
      The url for downloading pretrained word embedding.
      Note that we only prepare the default ``url`` for English with ``pretrained_word_emb_name``
      as ``"42B"``, ``"840B"``, 'twitter.27B' and '6B'.
  target_pretrained_word_emb_name: str, optional, default=None
      The name of pretrained word embedding in ``torchtext`` for target language.
      If it is set ``None``, we will use ``pretrained_word_emb_name``.
  target_pretrained_word_emb_url: str optional, default: ``None``
      The url for downloading pretrained word embedding for target language.
      Note that we only prepare the default ``url`` for English with ``pretrained_word_emb_name``
      as ``"42B"``, ``"840B"``, 'twitter.27B' and '6B'.
  pretrained_word_emb_cache_dir: str, optional, default: ``".vector_cache/"``
      The path of directory saving the temporary word embedding file.
  word_emb_size: int, optional
      Word embedding size, default: ``None``.
  share_vocab : boolean
      Specify whether to share vocab between input and output text, default: ``True``.
  
  Examples
  -------
  # Build a vocab model from scratch
  >>> vocab_model = VocabModel([['I like nlp.', 'Same here!'],
                      ['I like graph.', 'Same here!']],
                      max_word_vocab_size=None,
                      min_word_vocab_freq=1,
                      word_emb_size=300)
  >>> print(vocab_model.word_vocab.get_vocab_size())
  
  # Restore a vocab model from disk if exists or build one from scratch.
  >>> vocab_model = VocabModel.build('vocab_model.pkl', [['I like nlp.', 'Same here!'],
                          ['I like graph.', 'Same here!']],
                          max_word_vocab_size=None,
                          min_word_vocab_freq=1,
                          word_emb_size=300)
  >>> print(vocab_model.word_vocab.get_vocab_size())
docstr: Count vocabulary tokens.
code: def collect_vocabs(
      all_instances, tokenizer, lower_case=True, share_vocab=True
  ):
      """Count vocabulary tokens."""
      if share_vocab:
          all_words = Counter()
      else:
          all_words = [Counter(), Counter()]
  
      for instance in all_instances:
          extracted_tokens = instance.extract()
          if share_vocab:
              all_words.update(extracted_tokens)
          else:
              all_words[0].update(extracted_tokens[0])
              all_words[1].update(extracted_tokens[1])
  
      return all_words
  
imports: import os
  import pickle
  import re
  import warnings
  from collections import Counter
  from functools import lru_cache
  import numpy
  import torch
  from nltk.tokenize import word_tokenize
  from torchtext.vocab import GloVe, Vectors
  from .None import constants
label_desc: Use image node_id 3 for calling the VocabModel obj's underlying member method code with example usage: obj.collect_vocabs(all_instances, tokenizer, lower_case, share_vocab) and returns: all_words