Vectors
The EmbeddingVector class is encapsulated in vectors. This class object represents the one-dimensional vector type.
| Property | Type | Description |
|---|---|---|
| vector | list[float] | One-dimensional vector list. |
| dims | int | Vector dimensionality. |
| Method | Parameter | Return Value | Description |
|---|---|---|---|
| __init__ | obj: dict | None | Constructor: Initializes a vector object from a dictionary object. |
| to_struct | None | dict | Returns a dictionary object that contains the vector and dimension of the current vector class object. |
| from_struct | cls, obj:dict | EmbeddingVector | Inputs a dictionary and calls the class method to return a class object. |
Creating a Vector
The following example demonstrates how to create a vector type.
from aura_frame.multimodal.types import EmbeddingVector
vec_dict = {"vector": [1, 2, 3], "dims": 3}
vec = EmbeddingVector(vec_dict)
print(vec.vector)
print(vec.dims)
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot