如何删除有关使用Word2vec的gensim警告gensim \ matutils.py:737

时间:2018-08-29 08:26:51

标签: python gensim word2vec

我发现有关word2vec.similarity()的警告如下:

>d:\python\lib\site-packages\gensim\matutils.py:737: FutureWarning: Conversion of the second argument of issubdtype from `int` to `np.signedinteger` is deprecated. In future, it will be treated as `np.int32 == np.dtype(int).type`.
  if np.issubdtype(vec.dtype, np.int):

如何删除此警告?

1 个答案:

答案 0 :(得分:-2)

import warnings  
warnings.filterwarnings(action='ignore',category=UserWarning,module='gensim')  
warnings.filterwarnings(action='ignore',category=FutureWarning,module='gensim')