Skip to content

Commit

Permalink
Use hanging indents in SoftCossim.__init__
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Jan 28, 2018
1 parent 9782782 commit c7f0ce1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gensim/similarities/docsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ def __init__(self, corpus, similarity_matrix, num_best=None, chunksize=256):

# Remove the columns of the similarity matrix that correspond to terms outside corpus.
nonzero_columns = sorted(set((index for document in corpus for index, _ in document)))
identity_matrix = scipy.sparse.identity(similarity_matrix.shape[0],
dtype=similarity_matrix.dtype, format="csr")
identity_matrix = scipy.sparse.identity(
similarity_matrix.shape[0], dtype=similarity_matrix.dtype, format="csr")
with warnings.catch_warnings():
warnings.simplefilter("ignore", scipy.sparse.SparseEfficiencyWarning)
identity_matrix[nonzero_columns] = similarity_matrix.T[nonzero_columns]
Expand Down

0 comments on commit c7f0ce1

Please sign in to comment.