Package org.apache.lucene.demo.knn
package org.apache.lucene.demo.knn
KnnVector example code.
The vector dictionary used in the demo is taken from the GloVe project, whose data is in the public domain.
-
ClassDescriptionThis class provides
DemoEmbeddings.computeEmbedding(String)
andDemoEmbeddings.computeEmbedding(Reader)
for calculating "semantic" embedding vectors for textual input.Manages a map from token to numeric vector for use with KnnVector indexing and search.Looks up each tokens in a dictionary, and sums the token vectors.