2

Is there any way to load doc2vec model saved using gensim into deeplearning4j's ParagraphVectors?

My gensim model is valid - I am able to load it using gensim with no problems.

When I call WordVectorSerializer.readParagraphVectors on my model from Java it throws exception:

Exception in thread "main" java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:219)
    at java.util.zip.ZipFile.<init>(ZipFile.java:149)
    at java.util.zip.ZipFile.<init>(ZipFile.java:163)
    at org.deeplearning4j.models.embeddings.loader.WordVectorSerializer.readWord2Vec(WordVectorSerializer.java:889)
    at org.deeplearning4j.models.embeddings.loader.WordVectorSerializer.readParagraphVectors(WordVectorSerializer.java:825)
    at pl.org.opi.main.main(main.java:17)

Upon debugging the code, I noticed that deeplearning4j expects a zip file with multiple txt files and a single json file inside of it. Is there a way to convert the gensim model to the zip expected by deeplearning4j or is there a dedicated method for this in dl4j API (couldn't find any using examples and javadoc)?

dkaras
  • 195
  • 2
  • 12

0 Answers0