-1

运行此代码时出现此警告

model.save('raw_gutenberg_model.w2v')
model = gensim.models.Word2Vec.load('raw_gutenberg_model.w2v')
model['dog']

错误:

"/home/computer_name/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:1: DeprecationWarning: Call to deprecated `doesnt_match` (Method will be removed in 4.0.0, use self.wv.doesnt_match() instead).
  """Entry point for launching an IPython kernel."
4

1 回答 1

0

出现此警告是因为指定的函数将在未来版本中弃用,gensim并且作者希望用户清楚这一点。

您可以使用以下方法禁用这些警告:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
于 2018-10-29T13:11:11.853 回答