Fetch the repository succeeded.
下载的glove模型,如果直接使用:
self.__wvmodel = gensim.models.KeyedVectors.load_word2vec_format(self.__glove_file)
是无法使用的会报错:
invalid literal for int() with base 10: 'the'
原因:
下载的glove模型,是非word2vec向量形式,需要转换
转换方式:
使用glove2word2vec进行转换
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.
@xudongmk 您好,下载下来的模型确实不能直接使用的,需要在glove.6B.300d.txt文件的行首加入一行:“400000 300”;
相关说明可以参考ModelZoo的README.md的Dataset Preparation章节
Sign in to comment