Skip to content
New issue

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

Patch for /trunk/word2vec.c #16

Open
GoogleCodeExporter opened this issue Apr 21, 2015 · 0 comments
Open

Patch for /trunk/word2vec.c #16

GoogleCodeExporter opened this issue Apr 21, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Patch for bug, which caused discarding the last word of vocab after sorting if 
there was no newline character in the input file.

If there is no newline in the input file, vocab[0].cn==0, which is ignored in 
sorting, but is not in the for loop, where it decrements the vocab_size and 
frees the memory of the last word. However, it still computes the hash for the 
last word if its count is greater than min_count. Also the realloc needs to 
allocate only vocab_size * sizeof(struct vocab_word).

Original issue reported on code.google.com by FerroMrkva on 5 Feb 2014 at 11:24

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant