简体   繁体   English

在 google colab 上保存 gensim doc2vec 训练的 model

[英]save gensim doc2vec trained model on google colab

I am training text data using gensim doc2vec model on google colab repository GPU runtime, and want to save trained model in test.d2v file.我正在使用谷歌 colab 存储库 GPU 运行时上的 gensim doc2vec model 训练文本数据,并希望将经过训练的 model 保存在 test.d2v 文件中。 following is code snippet以下是代码片段

T = [TaggedDocument(doc, [i]) for i, doc in enumerate(data['info'])]
model = Doc2Vec(T,alpha=.025, min_alpha=.025, min_count=1)
model.save('test.d2v')

Following error is generated in colab notebook.在 colab 笔记本中生成以下错误。

** /usr/local/lib/python3.6/dist-packages/smart_open/smart_open_lib.py:253: UserWarning: This function is deprecated, use smart_open.open instead. ** /usr/local/lib/python3.6/dist-packages/smart_open/smart_open_lib.py:253:用户警告:此 function 已弃用,请改用 smart_open.open。 See the migration notes for details: https://github.com/RaRe-Technologies/smart_open/blob/master/README.rst#migrating-to-the-new-open-function 'See the migration notes for details: %s' % _MIGRATION_NOTES_URL有关详细信息,请参阅迁移说明: https://github.com/RaRe-Technologies/smart_open/blob/master/README.rst#migrating-to-the-new-open-function '有关详细信息,请参阅迁移说明:%s ' % _MIGRATION_NOTES_URL

A warning isn't necessarily an error, especially one that's just mentioning a 'deprecation'.警告不一定是错误,尤其是仅提及“弃用”的错误。 Does your save file work?你的存档有用吗? If so, it's safe to ignore this warning.如果是这样,忽略此警告是安全的。 See a prior answer for more details.有关更多详细信息,请参阅先前的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM