class_docstr: Bert-base Model preprocessor.
class_docstr_tok: ["Bert-base","Model","preprocessor","."]
docstr: Fit pre-processing context for transformation.
  
  :param verbose: Verbosity.
  :param data_pack: Data_pack to be preprocessed.
  :return: class:`BertPreprocessor` instance.
docstr_tok: ["Fit","pre-processing","context","for","transformation",".",":","param","verbose",":","Verbosity",".",":","param","data_pack",":","Data_pack","to","be","preprocessed",".",":","return",":","class",":","`","BertPreprocessor","`","instance","."]
code: def fit(self, data_pack: DataPack, verbose: int = 1):
      """
      Fit pre-processing context for transformation.
  
      :param verbose: Verbosity.
      :param data_pack: Data_pack to be preprocessed.
      :return: class:`BertPreprocessor` instance.
      """
      data_pack = data_pack.apply_on_text(
          chain_transform(self._units), verbose=verbose
      )
      fitted_filter_unit = build_unit_from_data_pack(
          self._filter_unit,
          data_pack,
          flatten=False,
          mode="right",
          verbose=verbose,
      )
      self._context["filter_unit"] = fitted_filter_unit
      self._context["vocab_unit"] = self._vocab_unit
      vocab_size = len(self._vocab_unit.state["term_index"])
      self._context["vocab_size"] = vocab_size
      self._context["embedding_input_dim"] = vocab_size
      self._context["input_shapes"] = [
          (self._fixed_length_left,),
          (self._fixed_length_right,),
      ]
      return self
  
file_path: MatchZoo/matchzoo/preprocessors/bert_preprocessor.py
imports: from tqdm import tqdm
  from .None import units
  from .chain_transform import chain_transform
  from matchzoo import DataPack
  from matchzoo.engine.base_preprocessor import BasePreprocessor
  from .build_vocab_unit import built_bert_vocab_unit
  from .build_unit_from_data_pack import build_unit_from_data_pack
label_desc: Use image node_id 2 for calling the BertPreprocessor obj's underlying member method code with example usage: obj.fit(data_pack, verbose) and returns: self