Class Word2VecModel
java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.FloatVectorValues
org.apache.lucene.analysis.synonym.word2vec.Word2VecModel
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 class org.apache.lucene.index.KnnVectorValues
KnnVectorValues.DocIndexIterator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTermAndVector(TermAndVector modelEntry) copy()intintsize()termValue(int targetOrd) float[]vectorValue(int targetOrd) float[]vectorValue(BytesRef term) Methods inherited from class org.apache.lucene.index.FloatVectorValues
checkField, fromFloats, getEncoding, scorerMethods inherited from class org.apache.lucene.index.KnnVectorValues
createDenseIterator, createSparseIterator, fromDISI, getAcceptOrds, getVectorByteLength, iterator, ordToDoc
-
Constructor Details
-
Word2VecModel
public Word2VecModel(int dictionarySize, int vectorDimension)
-
-
Method Details
-
addTermAndVector
-
vectorValue
public float[] vectorValue(int targetOrd) - Specified by:
vectorValuein classFloatVectorValues
-
vectorValue
-
termValue
-
dimension
public int dimension()- Specified by:
dimensionin classKnnVectorValues
-
size
public int size()- Specified by:
sizein classKnnVectorValues
-
copy
- Specified by:
copyin classFloatVectorValues- Throws:
IOException
-