dl4j Error loading Word vector

Source: Internet
Author: User

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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.