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
File "/users/home/docs/strdist.py", line 67, in <listcomp>
distances = np.array([[jac.distance(w1, w2) for w1 in tokens] for w2 in tokens])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/similarity/jaccard.py", line 32, in distance
return 1.0 - self.similarity(s0, s1)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/similarity/jaccard.py", line 51, in similarity
return 1.0 * inter / len(union)
ZeroDivisionError: float division by zero
And for Cosine distance
File "/users/home/docs/strdist.py", line 75, in <listcomp>
distances = np.array([[cos.distance(w1, w2) for w1 in tokens] for w2 in tokens])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/similarity/cosine.py", line 35, in distance
return 1.0 - self.similarity(s0, s1)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/similarity/cosine.py", line 49, in similarity
self._norm(profile0) * self._norm(profile1))
ZeroDivisionError: float division by zero
The text was updated successfully, but these errors were encountered:
For Jaccard distance
And for Cosine distance
The text was updated successfully, but these errors were encountered: