EmbeddingVector
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SCHEMA_EMBEDDING_PROPERTY_CONFIG)
public final class EmbeddingVector
Embeddings are vector representations of data, such as text, images, and audio, which can be generated by machine learning models and used for semantic search. This class represents an embedding vector, which wraps a float array for the values of the embedding vector and a model signature that can be any string to distinguish between embedding vectors generated by different models.
For more details on how embedding search works, check search and setRankingStrategy.
| See also | |
|---|---|
SearchSpec.Builder |
|
setPropertyEmbedding |
Summary
Public constructors |
|---|
EmbeddingVector(@NonNull float[] values, @NonNull String modelSignature)Creates a new |
Public methods |
|
|---|---|
boolean |
|
@NonNull String |
Returns the model signature of this embedding vector, which is an arbitrary string to distinguish between embedding vectors generated by different models. |
@NonNull float[] |
Returns the values of this embedding vector. |
int |
hashCode() |
Public constructors
EmbeddingVector
public EmbeddingVector(@NonNull float[] values, @NonNull String modelSignature)
Creates a new EmbeddingVector.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
Public methods
getModelSignature
public @NonNull String getModelSignature()
Returns the model signature of this embedding vector, which is an arbitrary string to distinguish between embedding vectors generated by different models.