Doc2vec: model.docvecs is only of length 10

只谈情不闲聊 提交于 2019-12-06 06:02:53

The tags of a TaggedDocument should be a list-of-tags. If you instead provided strings, like tags='73215', that would be seen as if the same as the list-of-characters:

tags=['7', '3', '2', '1', '5']

At the end, you'd only have 10 tags in your whole training set, just the 10 digits in various combinations.

That your len(model.docvec[1]) is 100 means you didn't make exactly this error, but perhaps something similar, in constructing your TaggedDocument training data.

Look at the first item in res, to see if its tags property makes sense, and each of the model.docvecs, to see what's being used instead of what you intended.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!