EmbeddedDocument
Wisej.AI.Embeddings.EmbeddedDocument
Namespace: Wisej.AI.Embeddings
Assembly: Wisej.AI (3.5.0.0)
Represents a document that can be embedded with metadata and embedding data.
public class EmbeddedDocument : ICloneable
The EmbeddedDocument class is designed to hold information about a document that can be embedded within a system. It contains properties for the document's name, metadata, and embedding data. This class provides constructors for initializing a document with or without embedding data. The embedded documents can be used in systems that require document similarity measures or need to store additional metadata for each document.
Constructors
EmbeddedDocument(name, metadata, embedding)

Initializes a new instance of the EmbeddedDocument class with the specified name, metadata, and embedding.
Throws:
ArgumentNullException Thrown when name is null.
Properties
Metadata

Metadata: Gets the metadata of the document.
Name

String: Gets the name of the document.
Methods
Clone(includeEmbedding)

Creates a deep copy of the current EmbeddedDocument instance.
Returns: EmbeddedDocument. A new EmbeddedDocument instance that is a deep copy of the current instance.
GetEmbedding()

Retrieves the embedding data associated with the document.
Returns: Embedding. The embedding data of the document.
GetMatches()

Returns: Matches.
SetEmbedding(embedding)

Sets the embedding data for the document.
Returns: EmbeddedDocument. The current instance of EmbeddedDocument with updated embedding data.
Use this method to update the embedding data of an existing document. This might be necessary when the document's context or representation changes.
var document = new EmbeddedDocument("SampleDoc");
var newEmbedding = new Embedding();
document.SetEmbedding(newEmbedding);
SetMatches(matches)

Returns: EmbeddedDocument.
Last updated