class_docstr: Term-Frequency document model (term = word).
class_docstr_tok: ["Term-Frequency","document","model","(","term","=","word",")","."]
code: def __init__(self, words, tokenizer=None):
      if isinstance(words, string_types) and tokenizer is None:
          raise ValueError(
              "Tokenizer has to be given if ``words`` is not a sequence."
          )
      elif isinstance(words, string_types):
          words = tokenizer.to_words(to_unicode(words))
      elif not isinstance(words, Sequence):
          raise ValueError(
              "Parameter ``words`` has to be sequence or string with tokenizer given."
          )
  
      self._terms = Counter(map(unicode.lower, words))
      self._max_frequency = (
          max(self._terms.values()) if self._terms else 1
      )
  
file_path: sumy/sumy/models/tf.py
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  import math
  from collections import Counter
  from pprint import pformat
  from .._compat import to_unicode, unicode, string_types, Sequence
label_desc: Use image node_id 1 to create a new TfDocumentModel object from inherited base classes: object with example: obj = TfDocumentModel(words, tokenizer)