class_docstr: CDSSM Model preprocessor.
docstr: CDSSM Model preprocessor.
  
  The word hashing step could eats up a lot of memory. To workaround
  this problem, set `with_word_hashing` to `False` and use a
  :class:`matchzoo.DynamicDataGenerator` with a
  :class:`matchzoo.preprocessor.units.WordHashing`.
  
  TODO: doc here.
  
  :param with_word_hashing: Include a word hashing step if `True`.
  
  Example:
      >>> import matchzoo as mz
      >>> train_data = mz.datasets.toy.load_data()
      >>> test_data = mz.datasets.toy.load_data(stage='test')
      >>> cdssm_preprocessor = mz.preprocessors.CDSSMPreprocessor()
      >>> train_data_processed = cdssm_preprocessor.fit_transform(
      ...     train_data, verbose=0
      ... )
      >>> type(train_data_processed)
      <class 'matchzoo.data_pack.data_pack.DataPack'>
      >>> test_data_transformed = cdssm_preprocessor.transform(test_data,
      ...                                                      verbose=0)
      >>> type(test_data_transformed)
      <class 'matchzoo.data_pack.data_pack.DataPack'>
docstr_tok: ["CDSSM","Model","preprocessor",".","The","word","hashing","step","could","eats","up","a","lot","of","memory",".","To","workaround","this","problem",",","set","`","with_word_hashing","`","to","`","False","`","and","use","a",":","class",":","`","matchzoo.DynamicDataGenerator","`","with","a",":","class",":","`","matchzoo.preprocessor.units.WordHashing","`",".","TODO",":","doc","here",".",":","param","with_word_hashing",":","Include","a","word","hashing","step","if","`","True","`",".","Example",":",">",">",">","import","matchzoo","as","mz",">",">",">","train_data","=","mz.datasets.toy.load_data","(",")",">",">",">","test_data","=","mz.datasets.toy.load_data","(","stage='test","'",")",">",">",">","cdssm_preprocessor","=","mz.preprocessors.CDSSMPreprocessor","(",")",">",">",">","train_data_processed","=","cdssm_preprocessor.fit_transform","(","...","train_data",",","verbose=0","...",")",">",">",">","type","(","train_data_processed",")","<","class","'matchzoo.data_pack.data_pack.DataPack","'",">",">",">",">","test_data_transformed","=","cdssm_preprocessor.transform","(","test_data",",","...","verbose=0",")",">",">",">","type","(","test_data_transformed",")","<","class","'matchzoo.data_pack.data_pack.DataPack","'",">"]
code: def __init__(
      self,
      fixed_length_left: int = 10,
      fixed_length_right: int = 40,
      with_word_hashing: bool = True,
  ):
      """
      CDSSM Model preprocessor.
  
      The word hashing step could eats up a lot of memory. To workaround
      this problem, set `with_word_hashing` to `False` and use a
      :class:`matchzoo.DynamicDataGenerator` with a
      :class:`matchzoo.preprocessor.units.WordHashing`.
  
      TODO: doc here.
  
      :param with_word_hashing: Include a word hashing step if `True`.
  
      Example:
          >>> import matchzoo as mz
          >>> train_data = mz.datasets.toy.load_data()
          >>> test_data = mz.datasets.toy.load_data(stage='test')
          >>> cdssm_preprocessor = mz.preprocessors.CDSSMPreprocessor()
          >>> train_data_processed = cdssm_preprocessor.fit_transform(
          ...     train_data, verbose=0
          ... )
          >>> type(train_data_processed)
          <class 'matchzoo.data_pack.data_pack.DataPack'>
          >>> test_data_transformed = cdssm_preprocessor.transform(test_data,
          ...                                                      verbose=0)
          >>> type(test_data_transformed)
          <class 'matchzoo.data_pack.data_pack.DataPack'>
  
      """
      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_value="0", pad_mode="post"
      )
      self._right_fixedlength_unit = units.FixedLength(
          self._fixed_length_right, pad_value="0", pad_mode="post"
      )
      self._with_word_hashing = with_word_hashing
  
file_path: MatchZoo/matchzoo/preprocessors/cdssm_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 build_vocab_unit
label_desc: Use image node_id 1 to create a new CDSSMPreprocessor object from inherited base classes: BasePreprocessor with example: obj = CDSSMPreprocessor(fixed_length_left, fixed_length_right, with_word_hashing)