class_docstr: DIIN Model preprocessor.
docstr: Fit pre-processing context for transformation.
  
  :param data_pack: data_pack to be preprocessed.
  :param verbose: Verbosity.
  :return: class:'DIINPreprocessor' instance.
code: def fit(self, data_pack: DataPack, verbose: int = 1):
      """
      Fit pre-processing context for transformation.
  
      :param data_pack: data_pack to be preprocessed.
      :param verbose: Verbosity.
      :return: class:'DIINPreprocessor' instance.
      """
      func = chain_transform(self._units)
      data_pack = data_pack.apply_on_text(
          func, mode="both", verbose=verbose
      )
  
      vocab_unit = build_vocab_unit(data_pack, verbose=verbose)
      vocab_size = len(vocab_unit.state["term_index"])
      self._context["vocab_unit"] = vocab_unit
      self._context["vocab_size"] = vocab_size
      self._context["embedding_input_dim"] = vocab_size
  
      data_pack = data_pack.apply_on_text(
          units.NgramLetter(ngram=1, reduce_dim=True).transform,
          mode="both",
          verbose=verbose,
      )
      char_unit = build_vocab_unit(data_pack, verbose=verbose)
      self._context["char_unit"] = char_unit
  
      self._context["input_shapes"] = [
          (self._fixed_length_left,),
          (self._fixed_length_right,),
          (
              self._fixed_length_left,
              self._fixed_length_word,
          ),
          (
              self._fixed_length_right,
              self._fixed_length_word,
          ),
          (self._fixed_length_left,),
          (self._fixed_length_right,),
      ]
      return self
  
file_path: MatchZoo/matchzoo/preprocessors/diin_preprocessor.py
imports: from tqdm import tqdm
  import pandas
  from matchzoo.engine.base_preprocessor import BasePreprocessor
  from matchzoo import DataPack
  from .build_vocab_unit import build_vocab_unit
  from .chain_transform import chain_transform
  from .None import units
label_desc: Use image node_id 2 for calling the DIINPreprocessor obj's underlying member method code with example usage: obj.fit(data_pack, verbose) and returns: self