【发布时间】:2018-11-29 09:45:04
【问题描述】:
我目前正在使用带有标记文档的自定义语料库
class ClassifyCorpus(object):
def __iter__(self):
with open(train_data) as fp:
for line in fp:
splt = line.split(':')
id = splt[0]
text = splt[1].replace('\n', '')
yield TaggedDocument(text.split(), [id])
查看布朗语料库的源代码,发现它只是从目录中读取并为我处理文档的标记。
我对其进行了测试,但没有发现训练速度有所提高。
【问题讨论】:
标签: python gensim corpus doc2vec