Word2VEC_java icon indicating copy to clipboard operation
Word2VEC_java copied to clipboard

加载loadGoogleModel后的单词编码不对,不知是什么问题。

Open kinglai opened this issue 9 years ago • 6 comments

我用gensim训练的Word2Vec用这个程序加载时发现词的编码不对。请教一下是什么问题呢?

kinglai avatar Sep 11 '16 07:09 kinglai

看我新提的issue,希望能帮到你

xuexingdong avatar Oct 20 '16 02:10 xuexingdong

必须uft-8格式

ansjsun avatar Dec 12 '16 13:12 ansjsun

#23

ansjsun avatar Mar 04 '17 02:03 ansjsun

在 Word2VEC 类的 loadGoogleModel 方法最后把 wordMap.put(word, vectors); //dis.read(); 注释掉

操作系统是window7 64位,java 1.8 我是python导出的二进制文件,然后用loadGoogleModel 加载模型,word有问题,后来发现每次读完后都有dis.read(); 导致下一个词的字节少了1位,最后把dis.read(); 注释掉就好了

swy0915 avatar Nov 24 '17 03:11 swy0915

已解决 一是注释掉//dis.read(); 注释掉 二还需要new string指定“utf-8”

IT-Xue avatar Jul 13 '22 13:07 IT-Xue

    您好,您的邮件我已收到!

dongliuliu avatar Jul 13 '22 13:07 dongliuliu