VEMB
VEMB key element [RAW]
- Available since:
- Redis CE 8.0.0
- Time complexity:
- O(1)
Return the approximate vector associated with a given element in the vector set.
VEMB word_embeddings SQL
1) "0.18208661675453186"
2) "0.08535309880971909"
3) "0.1365649551153183"
4) "-0.16501599550247192"
5) "0.14225517213344574"
... 295 more elements ...
Vector sets normalize and may quantize vectors on insertion. VEMB
reverses this process to approximate the original vector by de-normalizing and de-quantizing it.
To retrieve the raw internal representation, use the RAW
option:
VEMB word_embeddings apple RAW
1) int8
2) "\xf1\xdc\xfd\x1e\xcc%E...\xde\x1f\xfbN" # artificially shortened for this example
3) "3.1426539421081543"
4) "0.17898885905742645"
Required arguments
key
is the name of the key that holds the vector set.
element
is the name of the element whose vector you want to retrieve.
Optional arguments
RAW
returns the raw vector data, its quantization type, and metadata such as norm and range.
Related topics
RESP2 Reply
One of the following:
- Array reply: of real numbers as bulk strings, representing the vector.
- Array reply: consisting of the following elements:
- The quantization type as a simple string:
fp32
,bin
, orq8
. - A bulk string blob with the following raw data:
- 4-byte floats for fp32
- A bitmap for binary quantization
- A byte array for q8
- The L2 norm, as a simple string, of the vector before normalization.
- (Only for q8): The quantization range as a simple string. Multiply this by integer components to recover normalized values.
- The quantization type as a simple string:
RESP3 Reply
One of the following:
- Array reply: of doubles, representing the vector.
- Array reply: consisting of the following elements:
- The quantization type as a simple string:
fp32
,bin
, orq8
. - A bulk string blob with the following raw data:
- 4-byte floats for fp32
- A bitmap for binary quantization
- A byte array for q8
- The double L2 norm of the vector before normalization.
- (Only for q8): The quantization range as a double. Multiply this by integer components to recover normalized values.
- The quantization type as a simple string: