Class Word2VecModel
java.lang.Object
org.apache.lucene.analysis.synonym.word2vec.Word2VecModel
- All Implemented Interfaces:
RandomAccessVectorValues<float[]>
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTermAndVector(TermAndVector modelEntry) RandomAccessVectorValues<float[]> copy()intintsize()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, waitMethods inherited from interface org.apache.lucene.util.hnsw.RandomAccessVectorValues
getAcceptOrds, ordToDoc
-
Constructor Details
-
Word2VecModel
public Word2VecModel(int dictionarySize, int vectorDimension)
-
-
Method Details
-
addTermAndVector
-
vectorValue
public float[] vectorValue(int targetOrd) - Specified by:
vectorValuein interfaceRandomAccessVectorValues<float[]>
-
vectorValue
-
termValue
-
dimension
public int dimension()- Specified by:
dimensionin interfaceRandomAccessVectorValues<float[]>
-
size
public int size()- Specified by:
sizein interfaceRandomAccessVectorValues<float[]>
-
copy
- Specified by:
copyin interfaceRandomAccessVectorValues<float[]>- Throws:
IOException
-