def _compute_ranks(self, sigma, v_matrix):
    assert (len(sigma) == v_matrix.shape[0]), 'Matrices should be multiplicable'
    dimensions = max(LsaSummarizer.MIN_DIMENSIONS, int((len(sigma) * LsaSummarizer.REDUCTION_RATIO)))
    powered_sigma = tuple((((s ** 2) if (i < dimensions) else 0.0) for (i, s) in enumerate(sigma)))
    ranks = []
    for column_vector in v_matrix.T:
        rank = sum(((s * (v ** 2)) for (s, v) in zip(powered_sigma, column_vector)))
        ranks.append(math.sqrt(rank))
    return ranks
def _compute_ranks(self, sigma, v_matrix):
    assert (len(sigma) == v_matrix.shape[0]), 'Matrices should be multiplicable'
    dimensions = max(LsaSummarizer.MIN_DIMENSIONS, int((len(sigma) * LsaSummarizer.REDUCTION_RATIO)))
    powered_sigma = tuple((((s ** 2) if (i < dimensions) else 0.0) for (i, s) in enumerate(sigma)))
    ranks = []
    for column_vector in v_matrix.T:
        rank = sum(((s * (v ** 2)) for (s, v) in zip(powered_sigma, column_vector)))
        ranks.append(math.sqrt(rank))
    return ranks