Class Word2VecModel
java.lang.Object
org.apache.lucene.analysis.synonym.word2vec.Word2VecModel
- All Implemented Interfaces:
RandomAccessVectorValues
,RandomAccessVectorValues.Floats
Word2VecModel is a class representing the parsed Word2Vec model containing the vectors for each
word in dictionary
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
RandomAccessVectorValues.Bytes, RandomAccessVectorValues.Floats
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTermAndVector
(TermAndVector modelEntry) copy()
int
int
size()
termValue
(int targetOrd) float[]
vectorValue
(int targetOrd) float[]
vectorValue
(BytesRef term) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
getAcceptOrds, getSlice, ordToDoc
Methods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues.Floats
getVectorByteLength
-
Constructor Details
-
Word2VecModel
public Word2VecModel(int dictionarySize, int vectorDimension)
-
-
Method Details
-
addTermAndVector
-
vectorValue
public float[] vectorValue(int targetOrd) - Specified by:
vectorValue
in interfaceRandomAccessVectorValues.Floats
-
vectorValue
-
termValue
-
dimension
public int dimension()- Specified by:
dimension
in interfaceRandomAccessVectorValues
-
size
public int size()- Specified by:
size
in interfaceRandomAccessVectorValues
-
copy
- Specified by:
copy
in interfaceRandomAccessVectorValues
- Specified by:
copy
in interfaceRandomAccessVectorValues.Floats
- Throws:
IOException
-