def load_tfidf(corpus, dictionary):
if not os.path.isfile(TFIDF_MODEL_PATH):
print('Creating TF-IDF')
tfidf = models.TfidfModel(corpus)
print('TF-IDF created')
tfidf.save(TFIDF_MODEL_PATH)
print('Loading TF-IDF model')
tfidf = models.TfidfModel.load(TFIDF_MODEL_PATH)
return tfidf
# doc_list = get_data()
# print(len(doc_list))
评论列表
文章目录