Skip to content

Commit 00e86fa

Browse files
aa
git-svn-id: http://word2vec.googlecode.com/svn/trunk@26 c84ef02e-58a5-4c83-e53e-41fc32d635eb
1 parent cbff054 commit 00e86fa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

word2vec.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ void SortVocab() {
163163
train_words += vocab[a].cn;
164164
}
165165
}
166-
vocab_size++;
167-
vocab = (struct vocab_word *)realloc(vocab, vocab_size * sizeof(struct vocab_word));
166+
vocab = (struct vocab_word *)realloc(vocab, (vocab_size + 1) * sizeof(struct vocab_word));
168167
// Allocate memory for the binary tree construction
169168
for (a = 0; a < vocab_size; a++) {
170169
vocab[a].code = (char *)calloc(MAX_CODE_LENGTH, sizeof(char));
@@ -631,7 +630,7 @@ int main(int argc, char **argv) {
631630
printf("\t-hs <int>\n");
632631
printf("\t\tUse Hierarchical Softmax; default is 1 (0 = not used)\n");
633632
printf("\t-negative <int>\n");
634-
printf("\t\tNumber of negative examples; default is 5 (0 = not used)\n");
633+
printf("\t\tNumber of negative examples; default is 0, common values are 5 - 10 (0 = not used)\n");
635634
printf("\t-threads <int>\n");
636635
printf("\t\tUse <int> threads (default 1)\n");
637636
printf("\t-min-count <int>\n");

0 commit comments

Comments
 (0)