class_docstr: Produces inputs and answer spans for Squad.
class_docstr_tok: ["Produces","inputs","and","answer","spans","for","Squad","."]
docstr: Build vocabulary based on training corpus.
docstr_tok: ["Build","vocabulary","based","on","training","corpus","."]
code: def initialize(self, vocab_builder=None, from_scratch=True):
      """Build vocabulary based on training corpus."""
      if isinstance(self.tokenizer, WordPieceTokenizer):
          return
      if not self.vocab_builder or from_scratch:
          self.vocab_builder = vocab_builder or VocabBuilder()
          self.vocab_builder.pad_index = 0
          self.vocab_builder.unk_index = 1
      ques_initializer = self.ques_tensorizer.initialize(
          self.vocab_builder, from_scratch
      )
      doc_initializer = self.doc_tensorizer.initialize(
          self.vocab_builder, from_scratch
      )
      ques_initializer.send(None)
      doc_initializer.send(None)
      try:
          while True:
              row = yield
              ques_initializer.send(row)
              doc_initializer.send(row)
      except GeneratorExit:
          self.vocab = self.vocab_builder.make_vocab()
  
imports: from typing import List
  import torch
  from pytext.common.constants import SpecialTokens
  from pytext.config.component import ComponentType, create_component
  from pytext.data.tensorizers import TokenTensorizer
  from pytext.data.tokenizers import Tokenizer, WordPieceTokenizer
  from pytext.data.utils import pad_and_tensorize, VocabBuilder, Vocabulary
label_desc: Use image node_id 3 for calling the SquadTensorizer obj's underlying member method code with example usage: obj.initialize(vocab_builder, from_scratch) without return types