Embedding Class

  • java.lang.Object
    • com.microsoft.semantickernel.services.textembedding.Embedding

public class Embedding

Represents a strongly typed vector of numeric data.

Constructor Summary

Constructor Description
Embedding()

Initializes a new instance of the Embedding class.

Embedding(float[] vector)

Initializes a new instance of the Embedding class that contains numeric elements copied from the specified array

Embedding(List<Float> vector)

Initializes a new instance of the Embedding class that contains numeric elements copied from the specified collection

Method Summary

Modifier and Type Method and Description
static Embedding empty()

Returns an empty Embedding instance.

java.util.List<java.lang.Float> getVector()

Return the embedding vector as a read-only list.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

Embedding

public Embedding()

Initializes a new instance of the Embedding class.

Embedding

public Embedding(float[] vector)

Initializes a new instance of the Embedding class that contains numeric elements copied from the specified array

Parameters:

vector - The array whose elements are copied to the new Embedding

Embedding

public Embedding(List vector)

Initializes a new instance of the Embedding class that contains numeric elements copied from the specified collection

Parameters:

vector - The collection whose elements are copied to the new Embedding

Method Details

empty

public static Embedding empty()

Returns an empty Embedding instance.

Returns:

An empty Embedding instance.

getVector

public List getVector()

Return the embedding vector as a read-only list.

Returns:

The embedding vector as a read-only list.

Applies to