Skip to content

Commit

Permalink
使word2vec命令行参数解析与原版兼容:hankcs#699
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs authored and TylunasLi committed Dec 30, 2017
1 parent bb5599b commit 5ed83a5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ protected void setConfig(String[] args, Config config)
int i;
if ((i = argPos("-size", args)) >= 0) config.setLayer1Size(Integer.parseInt(args[i + 1]));
if ((i = argPos("-output", args)) >= 0) config.setOutputFile(args[i + 1]);
if ((i = argPos("-cbow", args)) >= 0) config.setUseContinuousBagOfWords(true);
if ((i = argPos("-cbow", args)) >= 0) config.setUseContinuousBagOfWords(Integer.parseInt(args[i + 1]) == 1);
if (config.useContinuousBagOfWords()) config.setAlpha(0.05f);
if ((i = argPos("-alpha", args)) >= 0) config.setAlpha(Float.parseFloat(args[i + 1]));
if ((i = argPos("-window", args)) >= 0) config.setWindow(Integer.parseInt(args[i + 1]));
if ((i = argPos("-sample", args)) >= 0) config.setSample(Float.parseFloat(args[i + 1]));
if ((i = argPos("-hs", args)) >= 0) config.setUseHierarchicalSoftmax(true);
if ((i = argPos("-hs", args)) >= 0) config.setUseHierarchicalSoftmax(Integer.parseInt(args[i + 1]) == 1);
if ((i = argPos("-negative", args)) >= 0) config.setNegative(Integer.parseInt(args[i + 1]));
if ((i = argPos("-threads", args)) >= 0) config.setNumThreads(Integer.parseInt(args[i + 1]));
if ((i = argPos("-iter", args)) >= 0) config.setIter(Integer.parseInt(args[i + 1]));
Expand Down

0 comments on commit 5ed83a5

Please sign in to comment.