We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hallo,
The code as it stands won't read a UTF-8 vocab from a word2vec binary model created using the C version of word2vec.
This is because the vocab's characters are appended to a string buffer as if a byte is a character.
A workaround/hack like this in Word2VecModel.java's fromBinFile() method gets around this issue and probably still works for single-byte characters:
byte[] buff = new byte[1024]; for (int lineno = 0; lineno < vocabSize; lineno++) { // read vocab int bpos = 0; byte b = buffer.get(); while (b != ' ') { if (b != '\n') { buff[bpos++] = b; } b = buffer.get(); } vocabs.add(new String(buff, 0, bpos, "UTF-8"));
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hallo,
The code as it stands won't read a UTF-8 vocab from a word2vec binary model created using the C version of word2vec.
This is because the vocab's characters are appended to a string buffer as if a byte is a character.
A workaround/hack like this in Word2VecModel.java's fromBinFile() method gets around this issue and probably still works for single-byte characters:
The text was updated successfully, but these errors were encountered: