Embedding
Namespace: Wisej.AI.Embeddings
Assembly: Wisej.AI
Represents an embedding which contains chunks of data, their associated vectors, and the model used for embedding.
- C#
- VB.NET
public class Embedding : ICloneable
Public Class Embedding
Inherits ICloneable
Constructors
Embedding(chunks, vectors, model)
Initializes a new instance of the Embedding class with specified chunks, vectors, and model.
| Name | Type | Description |
|---|---|---|
| chunks | String[] | An array of strings representing the data chunks to be embedded. |
| vectors | Single[][] | A jagged array of floats representing the vectors associated with the chunks. |
| model | String | A string representing the model used for embedding. |
This constructor initializes the Embedding class by setting the provided data chunks, their corresponding vectors, and the embedding model. The chunks parameter is used to input the raw data which will be embedded. The vectors parameter provides the associated vector representations for these chunks. The model specifies the model name used in the embedding process. Here is an example of how to create an instance of the Embedding class:
string[] chunks = { "data1", "data2" };
float[][] vectors = { new float[] { 1.0f, 2.0f }, new float[] { 3.0f, 4.0f } };
string model = "exampleModel";
Embedding embedding = new Embedding(chunks, vectors, model);
Properties
Chunks
String[]: Gets the chunks of data that were embedded.
Model
String: Gets the model name used for embedding.
Vectors
Single[][]: Gets the vectors associated with the data chunks.
Methods
Add(embedding)
Adds the vectors and chunks from embedding .
| Parameter | Type | Description |
|---|---|---|
| embedding | Embedding | The Embedding instance providing the values to combine. |
Returns: Embedding.
Clone()
Creates a deep copy of the current Embedding instance.
Returns: Embedding. A new Embedding instance that is a deep copy of the current instance.