最近在做一个关键词匹配系统,为了更好的效果, 添加一个关键词扩展的功能。使用Tencent AIlab的800万词向量文件。 腾讯AILAB的800万词向量下载地址:https://ai.tencent.com/ailab/nlp/zh/embedding.html 这个是最新的有效地址 是用gen
添加⼀个关键词扩展的功能。使⽤Tencent AIlab的800万词向量⽂件。是⽤gensim模块读取词向量,并找到相似词,占⽤内存⽐较⼤,速度也慢,最好是16g以上的内存和⾼主频的cpu import gensim wv_from_text = gensim.models.KeyedVectors.load_word2vec_format('./Tencent_AILab_ChineseEmbedding.txt',...
>>>fromgensim.models.keyedvectorsimportKeyedVectors>>>file='Tencent_AILab_ChineseEmbedding.txt'>>>wv_from_text=KeyedVectors.load_word2vec_format(file,binary=False) 该文件需要8-11G内存,我的内存只有16G 本身还占用了几G,而且Tencent_AILab_ChineseEmbedding.txt文件大小是16个G。 最后的解决方法是把交...