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
So, I iterated over a number of files in a folder and suddenly the program stopped and showed the following message. What is happening and what should I do?
Thank you in advance.
/home/gligur/.local/lib/python3.6/site-packages/wmd/__init__.py:668: RuntimeWarning: invalid value encountered in true_divide
w /= w.sum()
wmd: weights are not normalized: 0 != 1000000000
[10:38:02] or-tools/src/graph/min_cost_flow.cc:1097: Max flow could not be computed.
wmd: status is 5
Traceback (most recent call last):
File "/home/gligur/PycharmProjects/gligurtest/TopicClustering.py", line 26, in <module>
array[i] = doc1.similarity(doc2)
File "doc.pyx", line 370, in spacy.tokens.doc.Doc.similarity
File "/home/gligur/.local/lib/python3.6/site-packages/wmd/__init__.py", line 652, in compute_similarity
return libwmdrelax.emd(w1, w2, dists)
RuntimeError: negative cost was returned
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
When I had a similar problem with Spacy+WMD the reason was the empty document after Spacy removed the stop words. Spacy's stop word list contains the words that are not similar to other packages and quite extensive. That caused the document to became empty (well to be honest, the document contained a single line; "Re: will call :)". WMD-Relax should probably return NaN in those cases, my solution is try/expect around the distance calculation, and manually set the distance when an exception happens.
So, I iterated over a number of files in a folder and suddenly the program stopped and showed the following message. What is happening and what should I do?
Thank you in advance.
The text was updated successfully, but these errors were encountered: