class_docstr: Frequency filter unit.
  
  :param low: Lower bound, inclusive.
  :param high: Upper bound, exclusive.
  :param mode: One of `tf` (term frequency), `df` (document frequency),
      and `idf` (inverse document frequency).
  
  Examples::
      >>> import matchzoo as mz
  
  To filter based on term frequency (tf):
      >>> tf_filter = mz.preprocessors.units.FrequencyFilter(
      ...     low=2, mode='tf')
      >>> tf_filter.fit([['A', 'B', 'B'], ['C', 'C', 'C']])
      >>> tf_filter.transform(['A', 'B', 'C'])
      ['B', 'C']
  
  To filter based on document frequency (df):
      >>> tf_filter = mz.preprocessors.units.FrequencyFilter(
      ...     low=2, mode='df')
      >>> tf_filter.fit([['A', 'B'], ['B', 'C']])
      >>> tf_filter.transform(['A', 'B', 'C'])
      ['B']
  
  To filter based on inverse document frequency (idf):
      >>> idf_filter = mz.preprocessors.units.FrequencyFilter(
      ...     low=1.2, mode='idf')
      >>> idf_filter.fit([['A', 'B'], ['B', 'C', 'D']])
      >>> idf_filter.transform(['A', 'B', 'C'])
      ['A', 'C']
docstr: Transform a list of tokens by filtering out unwanted words.
code: def transform(self, input_: list) -> list:
      """Transform a list of tokens by filtering out unwanted words."""
      valid_terms = self._context[self._mode]
      return list(filter(lambda token: token in valid_terms, input_))
  
file_path: MatchZoo/matchzoo/preprocessors/units/frequency_filter.py
imports: import collections
  import typing
  import numpy
  from .stateful_unit import StatefulUnit
label_desc: Use image node_id 3 for calling the FrequencyFilter obj's underlying member method code with example usage: obj.transform(input_) and returns: list