word2vec_wiki.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:Book_DeepLearning_Practice 作者: wac81 项目源码 文件源码
def get_save_wikitext(wiki_filename,text_filename):
    output = open(text_filename, 'w')
    wiki = corpora.WikiCorpus(wiki_filename, lemmatize=False, dictionary={})
    for text in wiki.get_texts():
        # text = delNOTNeedWords(text,"../../stopwords.txt")[1]
        output.write(" ".join(text) + "\n")
        i = i + 1
        if (i % 10000 == 0):
            logging.info("Saved " + str(i) + " articles")
    output.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号