pub struct TaskSemanticEmbedding<'a> {
    pub prompt: Prompt<'a>,
    pub representation: SemanticRepresentation,
    pub compress_to_size: Option<u32>,
}
Expand description

Create embeddings for prompts which can be used for downstream tasks. E.g. search, classifiers

Fields

prompt: Prompt<'a>

The prompt (usually text) to be embedded.

representation: SemanticRepresentation

Semantic representation to embed the prompt with. This parameter is governed by the specific usecase in mind.

compress_to_size: Option<u32>

Default behaviour is to return the full embedding, but you can optionally request an embedding compressed to a smaller set of dimensions. A size of 128 is supported for every model.

The 128 size is expected to have a small drop in accuracy performance (4-6%), with the benefit of being much smaller, which makes comparing these embeddings much faster for use cases where speed is critical.

The 128 size can also perform better if you are embedding short texts or documents.

Trait Implementations

Formats the value using the given formatter. Read more

Serialize this value into the given Serde serializer. Read more

Output returned by Client::execute

Expected answer of the Aleph Alpha API

Prepare the request for the Aleph Alpha API. Authentication headers can be assumed to be already set. Read more

Parses the response of the server into higher level structs for the user.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more