You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to build a SparseTermSimilarityMatrix using Levenshtein it fails.
Steps/code/corpus to reproduce
index=LevenshteinSimilarityIndex(dictionary)
SparseTermSimilarityMatrix(index, dictionary) # <- fails here
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-59-c16b89564835> in <module>
----> 1 similarity_matrix1 = SparseTermSimilarityMatrix(similarity_index1, dictionary)
~/.local/share/virtualenvs/pdftagger-LHy_2RHk/lib/python3.6/site-packages/gensim/similarities/termsim.py in __init__(self, source, dictionary, tfidf, symmetric, positive_definite, nonzero_limit, dtype)
234 for term, similarity in index.most_similar(t1, topn=num_rows)
235 if term in dictionary.token2id
--> 236 ] if num_rows > 0 else []
237
238 if tfidf is None:
~/.local/share/virtualenvs/pdftagger-LHy_2RHk/lib/python3.6/site-packages/gensim/similarities/levenshtein.py in most_similar(self, t1, topn)
151 if similarity > 0
152 )
--> 153 return islice(most_similar, topn)
ValueError: Stop argument for islice() must be None or an integer: 0 <= x <= sys.maxsize.
Problem description
When trying to build a SparseTermSimilarityMatrix using Levenshtein it fails.
Steps/code/corpus to reproduce
Versions
Linux-4.18.0-25-generic-x86_64-with-debian-buster-sid
Python 3.6.9 (default, Nov 18 2019, 15:20:23)
[GCC 8.3.0]
NumPy 1.17.4
SciPy 1.3.3
gensim 3.8.1
FAST_VERSION 1
The text was updated successfully, but these errors were encountered: