Package org.apache.lucene.analysis.synonym.word2vec

# Class Dl4jModelReader

java.lang.Object
org.apache.lucene.analysis.synonym.word2vec.Dl4jModelReader

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class Dl4jModelReader extends Object implements Closeable
Dl4jModelReader reads the file generated by the library Deeplearning4j and provide a Word2VecModel with normalized vectors

Dl4j Word2Vec documentation: https://deeplearning4j.konduit.ai/v/en-1.0.0-beta7/language-processing/word2vec Example to generate a model using dl4j: https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/advanced/modelling/embeddingsfromcorpus/word2vec/Word2VecRawTextExample.java

WARNING: This API is experimental and might change in incompatible ways in the next release.

## Constructor Summary

Constructors
Constructor
Description
`Dl4jModelReader(InputStream stream)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`Word2VecModel`
`read()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Dl4jModelReader

public Dl4jModelReader(InputStream stream)

## Method Details

### read

public Word2VecModel read() throws IOException

Throws:
  `IOException`

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Throws:
  `IOException`