Table of Contents

Class EncodingOptions

Namespace
AiDotNet.Tokenization.Models
Assembly
AiDotNet.dll

Options for encoding text into tokens.

public class EncodingOptions
Inheritance
EncodingOptions
Inherited Members

Constructors

EncodingOptions()

Creates default encoding options.

public EncodingOptions()

Properties

AddSpecialTokens

Gets or sets whether to add special tokens (e.g., [CLS], [SEP]).

public bool AddSpecialTokens { get; set; }

Property Value

bool

MaxLength

Gets or sets the maximum sequence length. Sequences longer than this will be truncated.

public int? MaxLength { get; set; }

Property Value

int?

Padding

Gets or sets whether to pad sequences to MaxLength.

public bool Padding { get; set; }

Property Value

bool

PaddingSide

Gets or sets the padding side ("right" or "left").

public string PaddingSide { get; set; }

Property Value

string

ReturnAttentionMask

Gets or sets whether to return attention masks.

public bool ReturnAttentionMask { get; set; }

Property Value

bool

ReturnOffsets

Gets or sets whether to return character offsets.

public bool ReturnOffsets { get; set; }

Property Value

bool

ReturnPositionIds

Gets or sets whether to return position IDs.

public bool ReturnPositionIds { get; set; }

Property Value

bool

ReturnTokenTypeIds

Gets or sets whether to return token type IDs.

public bool ReturnTokenTypeIds { get; set; }

Property Value

bool

Stride

Gets or sets the stride for overflow handling (used when truncating).

public int Stride { get; set; }

Property Value

int

Truncation

Gets or sets whether to truncate sequences that exceed MaxLength.

public bool Truncation { get; set; }

Property Value

bool

TruncationSide

Gets or sets the truncation side ("right" or "left").

public string TruncationSide { get; set; }

Property Value

string