File gModel = new File("D:/FluidAI/WordVec/pathToSaveModel.txt");
Word2Vec vecs = WordVectorSerializer.readWord2VecModel(gModel);//("D:/FluidAI/WordVec/pathToSaveModel.txt");
vecs.setTokenizerFactory(t);
vecs.setSentenceIter(iter);
//vecs.set
vecs.fit();
WordVectorSerializer.writeWordVectors(vecs, "pathToWriteto.txt");
WordVectorSerializer.writeWord2VecModel(vecs, "pathToSaveModel.txt");
Collection<String> st=vecs.wordsNearest("enclave", 10);
System.out.println(st);
double cosSim = vecs.similarity("extn", "dausa");
System.out.println(cosSim);
在 vecs.similarity 中,traning 后抛出空指针异常