256 Star 916 Fork 294

MindSpore / docs

加载glove模型

Bug-Report
DONE
xudongmk  Opened this issue

下载的glove模型,如果直接使用:
self.__wvmodel = gensim.models.KeyedVectors.load_word2vec_format(self.__glove_file)
是无法使用的会报错:
invalid literal for int() with base 10: 'the'

原因:
下载的glove模型,是非word2vec向量形式,需要转换

转换方式:
使用glove2word2vec进行转换

Attachments
5518576 mindspore ci 1587902139 total 3 participants

Comments (2)

5518576 mindspore ci 1587902139
mindspore-ci-bot 2020-08-26 16:02 member

Hey xudongmk, Welcome to MindSpore Community.
All of the projects in MindSpore Community are maintained by @mindspore-ci-bot .
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at https://gitee.com/mindspore/community/blob/master/command.md to find the details.

caojian05 2020-09-07 16:08

@xudongmk 您好,下载下来的模型确实不能直接使用的,需要在glove.6B.300d.txt文件的行首加入一行:“400000 300”;

相关说明可以参考ModelZoo的README.md的Dataset Preparation章节

输入图片说明

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
1
https://gitee.com/mindspore/docs.git
git@gitee.com:mindspore/docs.git
mindspore
docs
docs

Search