Unable to guess input file format. Please use corresponding loader directly
Focus
Save the model, Wordvectorserializer.writefullmodel (VEC, filepath+ ". Vec");
When read,
wordvectors wordvectors =wordvectorserializer.loadfullmodel (Word_vectors_path)
Later debugging, found that different methods, training after the model file, the format is not the same, so need to study carefully, and the gill-style.
If you have trouble, use their corresponding reading and writing method is good ~
Logging:
Using the Word2vec Google version of the training, binary and TXT format are not, both error.
Google Code training Word vectors, dl4j always load not up. Re-train with dl4j
Try dl4j the code of your own training word vector. The model files after training are saved in
Word2vecrawtextexample
uses a unary participle of Chinese, which is delimited by each char space.
Word2vec VEC = new Word2vec.builder ()
. Minwordfrequency (5)
. Iterations (1).
layersize (
+). Seed (windowsize)
(5)
. Iterate (ITER).
tokenizerfactory (t)
. Build ();
Save the model, Wordvectorserializer.writefullmodel (VEC, filepath+ ". Vec");
Try the nearest method, the effect is good.
Pot: [Pot, grate, stove, burn, stove, quench, roast, burn, fry, Burn]