class_docstr: DIIN Model preprocessor.
docstr: DIIN Model preprocessor.
  
  :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 fixed_length_word: Integer, maximize length of each word.
  
  Example:
      >>> import matchzoo as mz
      >>> train_data = mz.datasets.toy.load_data()
      >>> test_data = mz.datasets.toy.load_data(stage='test')
      >>> diin_preprocessor = mz.preprocessors.DIINPreprocessor(
      ...     fixed_length_left=5,
      ...     fixed_length_right=5,
      ...     fixed_length_word=3,
      ... )
      >>> diin_preprocessor = diin_preprocessor.fit(
      ...     train_data, verbose=0)
      >>> diin_preprocessor.context['input_shapes']
      [(5,), (5,), (5, 3), (5, 3), (5,), (5,)]
      >>> diin_preprocessor.context['vocab_size']
      893
      >>> train_data_processed = diin_preprocessor.transform(
      ...     train_data, verbose=0)
      >>> type(train_data_processed)
      <class 'matchzoo.data_pack.data_pack.DataPack'>
      >>> test_data_processed = diin_preprocessor.transform(
      ...     test_data, verbose=0)
      >>> type(test_data_processed)
      <class 'matchzoo.data_pack.data_pack.DataPack'>
code: def __init__(
      self,
      fixed_length_left: int = 10,
      fixed_length_right: int = 10,
      fixed_length_word: int = 5,
  ):
      """
      DIIN Model preprocessor.
  
      :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 fixed_length_word: Integer, maximize length of each word.
  
      Example:
          >>> import matchzoo as mz
          >>> train_data = mz.datasets.toy.load_data()
          >>> test_data = mz.datasets.toy.load_data(stage='test')
          >>> diin_preprocessor = mz.preprocessors.DIINPreprocessor(
          ...     fixed_length_left=5,
          ...     fixed_length_right=5,
          ...     fixed_length_word=3,
          ... )
          >>> diin_preprocessor = diin_preprocessor.fit(
          ...     train_data, verbose=0)
          >>> diin_preprocessor.context['input_shapes']
          [(5,), (5,), (5, 3), (5, 3), (5,), (5,)]
          >>> diin_preprocessor.context['vocab_size']
          893
          >>> train_data_processed = diin_preprocessor.transform(
          ...     train_data, verbose=0)
          >>> type(train_data_processed)
          <class 'matchzoo.data_pack.data_pack.DataPack'>
          >>> test_data_processed = diin_preprocessor.transform(
          ...     test_data, verbose=0)
          >>> type(test_data_processed)
          <class 'matchzoo.data_pack.data_pack.DataPack'>
  
      """
      super().__init__()
      self._fixed_length_left = fixed_length_left
      self._fixed_length_right = fixed_length_right
      self._fixed_length_word = fixed_length_word
      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._units = self._default_units()
  
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 1 to create a new DIINPreprocessor object from inherited base classes: BasePreprocessor with example: obj = DIINPreprocessor(fixed_length_left, fixed_length_right, fixed_length_word)