ITextEncoder<T>

Interfaces · AiDotNet.VisionLanguage.Interfaces

Interface for text encoders that extract feature representations from text.

Known implementations: IContrastiveVisionLanguageModel<T>

For Beginners

A text encoder converts words and sentences into numbers that represent their meaning. Similar sentences get similar numbers, which lets the model compare text with images in the same mathematical space.

How It Works

Text encoders transform text strings into compact feature representations (embeddings) that capture semantic meaning. In vision-language models, text embeddings are aligned with visual embeddings in a shared space for cross-modal tasks.

Properties

Property Summary
int MaxSequenceLength { get; } Gets the maximum token sequence length supported by this encoder.
int TextEmbeddingDimension { get; } Gets the dimensionality of the output text embedding space.

Methods

Method Summary
Tensor<T> EncodeText(string text) Encodes a text string into an embedding vector.
Tensor<T>[] EncodeTexts(string[] texts) Encodes multiple text strings into embedding vectors.