class_docstr: Method that greedily adds sentences to a summary so long as it decreases the
  KL Divergence.
  Source: http://www.aclweb.org/anthology/N09-1041
class_docstr_tok: ["Method","that","greedily","adds","sentences","to","a","summary","so","long","as","it","decreases","the","KL","Divergence",".","Source",":","http",":","\/\/www.aclweb.org\/anthology\/N09-1041"]
docstr: Note: Could import scipy.stats and use scipy.stats.entropy(doc_freq, summary_freq)
  but this gives equivalent value without the import
docstr_tok: ["Note",":","Could","import","scipy.stats","and","use","scipy.stats.entropy","(","doc_freq",",","summary_freq",")","but","this","gives","equivalent","value","without","the","import"]
code: def _kl_divergence(summary_freq, doc_freq):
      """
      Note: Could import scipy.stats and use scipy.stats.entropy(doc_freq, summary_freq)
      but this gives equivalent value without the import
      """
      sum_val = 0
      for w in summary_freq:
          frequency = doc_freq.get(w)
          if frequency:  # missing or zero = no frequency
              sum_val += frequency * math.log(
                  frequency / summary_freq[w]
              )
  
      return sum_val
  
file_path: sumy/sumy/summarizers/kl.py
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  import math
  from ._summarizer import AbstractSummarizer
label_desc: Use image node_id 10 for calling the KLSummarizer obj's underlying member method code with example usage: obj._kl_divergence(summary_freq, doc_freq) and returns: sum_val