docstr: Computes TF metrics for each sentence (column) in the given matrix.
  You can read more about smoothing parameter at URL below:
  http://nlp.stanford.edu/IR-book/html/htmledition/maximum-tf-normalization-1.html
docstr_tok: ["Computes","TF","metrics","for","each","sentence","(","column",")","in","the","given","matrix",".","You","can","read","more","about","smoothing","parameter","at","URL","below",":","http",":","\/\/nlp.stanford.edu\/IR-book\/html\/htmledition\/maximum-tf-normalization-1.html"]
code: def _compute_term_frequency(self, matrix, smooth=0.4):
      """
      Computes TF metrics for each sentence (column) in the given matrix.
      You can read more about smoothing parameter at URL below:
      http://nlp.stanford.edu/IR-book/html/htmledition/maximum-tf-normalization-1.html
      """
      assert 0.0 <= smooth < 1.0
  
      max_word_frequencies = numpy.max(matrix, axis=0)
      rows, cols = matrix.shape
      for row in range(rows):
          for col in range(cols):
              max_word_frequency = max_word_frequencies[col]
              if max_word_frequency != 0:
                  frequency = matrix[row, col] / max_word_frequency
                  matrix[row, col] = smooth + (1.0 - smooth) * frequency
  
      return matrix
  
file_path: sumy/sumy/summarizers/lsa.py
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  import math
  from warnings import warn
  from ._summarizer import AbstractSummarizer
label_desc: Use image node_id 7 for calling the LsaSummarizer obj's underlying member method code with example usage: obj._compute_term_frequency(matrix, smooth) and returns: matrix