AnnoyReader class for approximate nearest neighbor lookups.
AnnoyReader class for approximate nearest neighbor lookups. Supports vector lookup by item as well as nearest neighbor lookup by vector.
Enhanced version of SCollection with Annoy methods
Enhanced version of ScioContext with Annoy methods.
Represents the base URI for an Annoy tree, either on the local or a remote file system.
Main package for Annoy side input APIs. Import all.
import com.spotify.scio.extra.annoy._
Two metrics are available, Angular and Euclidean.
To save an
SCollection[(Int, Array[Float])]
to an Annoy file:Save to a temporary location:
Save to a specific location:
SCollection[AnnoyUri]
can be converted into a side input:There's syntactic sugar for saving an SCollection and converting it to a side input:
An existing Annoy file can be converted to a side input directly:
sc.annoySideInput(metric, dimension, numTrees, "gs:///" )
AnnoyReader
provides nearest neighbor lookups by vector as well as item lookups: