【发布时间】:2018-04-03 16:50:21
【问题描述】:
我想用Gensim TaggedDocument() 标记一个文档列表,然后将这些文档作为Doc2Vec() 的输入传递。
我已阅读有关TaggedDocument here 的文档,但我不明白words 和tags 的参数究竟是什么。
我试过了:
texts = [[word for word in document.lower().split()]
for document in X.values]
texts = [[token for token in text]
for text in texts]
model = gensim.models.Doc2Vec(texts, vector_size=200)
model.train(texts, total_examples=len(texts), epochs=10)
但我收到错误'list' object has no attribute 'words'。
【问题讨论】: