From 8d29125f9506ee7f22f2ec73e3ca95190dc1a9c2 Mon Sep 17 00:00:00 2001 From: Aryaz Eghbali Date: Mon, 5 Jun 2023 15:48:03 +0200 Subject: [PATCH] Fixed bug with power iteration --- sumy/summarizers/lex_rank.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sumy/summarizers/lex_rank.py b/sumy/summarizers/lex_rank.py index c6d230a5..85f0bf2f 100644 --- a/sumy/summarizers/lex_rank.py +++ b/sumy/summarizers/lex_rank.py @@ -164,6 +164,7 @@ def power_method(matrix, epsilon): 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