class_docstr: LexRank: Graph-based Centrality as Salience in Text Summarization
  Source: http://tangra.si.umich.edu/~radev/lexrank/lexrank.pdf
class_docstr_tok: ["LexRank",":","Graph-based","Centrality","as","Salience","in","Text","Summarization","Source",":","http",":","\/\/tangra.si.umich.edu\/~radev\/lexrank\/lexrank.pdf"]
code: def power_method(matrix, epsilon):
      transposed_matrix = matrix.T
      sentences_count = len(matrix)
      p_vector = numpy.array([1.0 / sentences_count] * sentences_count)
      lambda_val = 1.0
  
      while lambda_val > epsilon:
          next_p = numpy.dot(transposed_matrix, p_vector)
          next_p /= numpy.linalg.norm(next_p)
          lambda_val = numpy.linalg.norm(
              numpy.subtract(next_p, p_vector)
          )
          p_vector = next_p
  
      return p_vector
  
file_path: sumy/sumy/summarizers/lex_rank.py
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  import math
  from collections import Counter
  from ._summarizer import AbstractSummarizer
label_desc: Use image node_id 11 for calling the LexRankSummarizer obj's underlying member method code with example usage: obj.power_method(matrix, epsilon) and returns: p_vector