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: Initialization.
code: def __init__(
      self,
      fixed_length_left: int = 30,
      fixed_length_right: int = 30,
      filter_mode: str = "df",
      filter_low_freq: float = 2,
      filter_high_freq: float = float("inf"),
      remove_stop_words: bool = False,
  ):
      """Initialization."""
      super().__init__()
      self._fixed_length_left = fixed_length_left
      self._fixed_length_right = fixed_length_right
      self._left_fixedlength_unit = units.FixedLength(
          self._fixed_length_left, pad_mode="post"
      )
      self._right_fixedlength_unit = units.FixedLength(
          self._fixed_length_right, pad_mode="post"
      )
      self._filter_unit = units.FrequencyFilter(
          low=filter_low_freq, high=filter_high_freq, mode=filter_mode
      )
      self._units = self._default_units()
      if remove_stop_words:
          self._units.append(units.stop_removal.StopRemoval())
  
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 1 to create a new BasicPreprocessor object from inherited base classes: BasePreprocessor with example: obj = BasicPreprocessor(fixed_length_left, fixed_length_right, filter_mode, filter_low_freq, filter_high_freq, remove_stop_words)