class_docstr: DIIN Model preprocessor.
docstr: Apply transformation on data.
  
  :param data_pack: Inputs to be preprocessed.
  :param verbose: Verbosity.
  
  :return: Transformed data as :class:'DataPack' object.
code: def transform(
      self, data_pack: DataPack, verbose: int = 1
  ) -> DataPack:
      """
      Apply transformation on data.
  
      :param data_pack: Inputs to be preprocessed.
      :param verbose: Verbosity.
  
      :return: Transformed data as :class:'DataPack' object.
      """
      data_pack = data_pack.copy()
      data_pack.apply_on_text(
          chain_transform(self._units),
          mode="both",
          inplace=True,
          verbose=verbose,
      )
  
      # Process character representation
      data_pack.apply_on_text(
          units.NgramLetter(ngram=1, reduce_dim=False).transform,
          rename=("char_left", "char_right"),
          mode="both",
          inplace=True,
          verbose=verbose,
      )
      char_index_dict = self._context["char_unit"].state["term_index"]
      left_charindex_unit = units.CharacterIndex(
          char_index_dict,
          self._fixed_length_left,
          self._fixed_length_word,
      )
      right_charindex_unit = units.CharacterIndex(
          char_index_dict,
          self._fixed_length_right,
          self._fixed_length_word,
      )
      data_pack.left["char_left"] = data_pack.left["char_left"].apply(
          left_charindex_unit.transform
      )
      data_pack.right["char_right"] = data_pack.right[
          "char_right"
      ].apply(right_charindex_unit.transform)
  
      # Process word representation
      data_pack.apply_on_text(
          self._context["vocab_unit"].transform,
          mode="both",
          inplace=True,
          verbose=verbose,
      )
  
      # Process exact match representation
      frame = data_pack.relation.join(
          data_pack.left, on="id_left", how="left"
      ).join(data_pack.right, on="id_right", how="left")
      left_exactmatch_unit = units.WordExactMatch(
          self._fixed_length_left,
          match="text_left",
          to_match="text_right",
      )
      right_exactmatch_unit = units.WordExactMatch(
          self._fixed_length_right,
          match="text_right",
          to_match="text_left",
      )
      data_pack.relation["match_left"] = frame.apply(
          left_exactmatch_unit.transform, axis=1
      )
      data_pack.relation["match_right"] = frame.apply(
          right_exactmatch_unit.transform, axis=1
      )
  
      data_pack.apply_on_text(
          self._left_fixedlength_unit.transform,
          mode="left",
          inplace=True,
          verbose=verbose,
      )
      data_pack.apply_on_text(
          self._right_fixedlength_unit.transform,
          mode="right",
          inplace=True,
          verbose=verbose,
      )
  
      return data_pack
  
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 3 for calling the DIINPreprocessor obj's underlying member method code with example usage: obj.transform(data_pack, verbose) and returns: data_pack