Skip to main content
 首页 » 编程设计

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

2025年05月04日10mate10pro

我发现关于 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): 

我该怎么做才能删除此警告?

请您参考如下方法:

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