| as_embedding | R Documentation |
Packs numeric vectors into the hex float32 blobs vectra stores embedding
columns as. Write the result as an ordinary character column; the distance
functions cosine(), l2(), and dot() decode it inside the engine.
as_embedding(x)
x |
A numeric matrix (one embedding per row), a list of equal-length numeric vectors, or a single numeric vector (one embedding). |
A character vector with one hex-encoded blob per embedding.
cosine(), l2(), dot()
m <- matrix(rnorm(12), nrow = 3) # 3 embeddings of length 4
emb <- as_embedding(m)
df <- data.frame(id = 1:3, emb = emb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.