def precompute(db, dir):
m = megatron.Megatron(db)
m.database.drop_all()
m.database.create_database()
importer = import_book.BookImporter(m)
progress = progressbar.ProgressBar()
importer.import_from(dir, progress)
counting_worker.run(m)
tfidf = tf_idf.TFIDF(m)
tfidf.compute_idf()
tfidf.compute_tfidf()
tfidf.compute_top_words()
评论列表
文章目录