Table of Contents

Class Embedder

Namespace
LMKit.Embeddings
Assembly
LM-Kit.NET.dll

A class designed for embeddings.
It facilitates execution of tasks related to natural language and coding, such as semantic search, clustering, topic modeling, and classification.

public sealed class Embedder
Inheritance
Embedder
Inherited Members

Constructors

Embedder(LLM)

Creates an instance of the Embedder class.

Properties

Model

Gets the Model instance associated with this object.

Methods

GetCosineSimilarity(IList<float>, IList<float>)

Calculates the cosine similarity between two vectors, representing the cosine of the angle between them in a multidimensional space.

GetEmbeddings(IList<int>, CancellationToken)

Generates the embedding vector for a given tokenized text.
This vector represents the text in a high-dimensional space, enabling various natural language processing tasks by capturing semantic meaning.

GetEmbeddings(string, CancellationToken)

Generates the embedding vector for a given text string.
This vector represents the text in a high-dimensional space, enabling various natural language processing tasks by capturing semantic meaning.

GetEmbeddingsAsync(IList<int>, CancellationToken)

Generates the embedding vector for a given tokenized text.
This vector represents the text in a high-dimensional space, enabling various natural language processing tasks by capturing semantic meaning.

GetEmbeddingsAsync(string, CancellationToken)

Generates the embedding vector for a given text string.
This vector represents the text in a high-dimensional space, enabling various natural language processing tasks by capturing semantic meaning.