def train_tag_doc(doc1):
docs = []
analyzedDocument = namedtuple('AnalyzedDocument', 'words tags')
for i, text in enumerate(doc1):
words = text.lower().split()
tags = [i]
docs.append(analyzedDocument(words, tags))
#docs.append(gensim.models.doc2vec.TaggedDocument(words, [i]))
return doc
评论列表
文章目录