PathSentenceLine源代码,其实就是传入一个文件夹路径。注意PathLineSentences的input_dir下是有多个语料数据文件,然后采用iterator方式加载训练数据到内存。
https://github.com/RaRe-Technologies/gensim/blob/58b30d71358964f1fc887477c5dc1881b634094a/gensim/models/word2vec.py#L1620
也许可以解决内存问题,暂且一试。
https://stackoverflow.com/questions/46899062/gensim-word2vec-uses-too-much-memory#
以下是文档:
https://radimrehurek.com/gensim/models/word2vec.html
(因为时间太紧张,所以根本没时间整理。先把链接撂到这里好了,等有时间的时候自己做个界面写博客。这个FLAG先立在这里咯~~)