class_docstr: Baisc preprocessor helper.
  
  :param fixed_length_left: Integer, maximize length of :attr:`left` in the
      data_pack.
  :param fixed_length_right: Integer, maximize length of :attr:`right` in the
      data_pack.
  :param filter_mode: String, mode used by :class:`FrequenceFilterUnit`, Can
      be 'df', 'cf', and 'idf'.
  :param filter_low_freq: Float, lower bound value used by
      :class:`FrequenceFilterUnit`.
  :param filter_high_freq: Float, upper bound value used by
      :class:`FrequenceFilterUnit`.
  :param remove_stop_words: Bool, use :class:`StopRemovalUnit` unit or not.
  
  Example:
      >>> import matchzoo as mz
      >>> train_data = mz.datasets.toy.load_data('train')
      >>> test_data = mz.datasets.toy.load_data('test')
      >>> preprocessor = mz.preprocessors.BasicPreprocessor(
      ...     fixed_length_left=10,
      ...     fixed_length_right=20,
      ...     filter_mode='df',
      ...     filter_low_freq=2,
      ...     filter_high_freq=1000,
      ...     remove_stop_words=True
      ... )
      >>> preprocessor = preprocessor.fit(train_data, verbose=0)
      >>> preprocessor.context['input_shapes']
      [(10,), (20,)]
      >>> preprocessor.context['vocab_size']
      228
      >>> processed_train_data = preprocessor.transform(train_data,
      ...                                               verbose=0)
      >>> type(processed_train_data)
      <class 'matchzoo.data_pack.data_pack.DataPack'>
      >>> test_data_transformed = preprocessor.transform(test_data,
      ...                                                verbose=0)
      >>> type(test_data_transformed)
      <class 'matchzoo.data_pack.data_pack.DataPack'>
docstr: Apply transformation on data, create fixed length representation.
  
  :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, create fixed length representation.
  
      :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), inplace=True, verbose=verbose
      )
  
      data_pack.apply_on_text(
          self._context["filter_unit"].transform,
          mode="right",
          inplace=True,
          verbose=verbose,
      )
      data_pack.apply_on_text(
          self._context["vocab_unit"].transform,
          mode="both",
          inplace=True,
          verbose=verbose,
      )
      data_pack.append_text_length(inplace=True, verbose=verbose)
      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,
      )
  
      max_len_left = self._fixed_length_left
      max_len_right = self._fixed_length_right
  
      data_pack.left["length_left"] = data_pack.left[
          "length_left"
      ].apply(lambda val: min(val, max_len_left))
  
      data_pack.right["length_right"] = data_pack.right[
          "length_right"
      ].apply(lambda val: min(val, max_len_right))
      return data_pack
  
file_path: MatchZoo/matchzoo/preprocessors/basic_preprocessor.py
imports: from tqdm import tqdm
  from .None import units
  from matchzoo import DataPack
  from matchzoo.engine.base_preprocessor import BasePreprocessor
  from .build_vocab_unit import build_vocab_unit
  from .build_unit_from_data_pack import build_unit_from_data_pack
  from .chain_transform import chain_transform
label_desc: Use image node_id 3 for calling the BasicPreprocessor obj's underlying member method code with example usage: obj.transform(data_pack, verbose) and returns: data_pack