Constructor MlChunkTokenizer
MlChunkTokenizer(Tokenizer, int, int, string?)
Wraps tokenizer as an IChunkTokenizer.
public MlChunkTokenizer(Tokenizer tokenizer, int maxSequenceLength, int specialTokenOverhead, string? id = null)
Parameters
tokenizerTokenizerThe underlying
Microsoft.ML.Tokenizerstokenizer.maxSequenceLengthintThe model ceiling, special tokens included.
specialTokenOverheadintTokens the encoder adds that
tokenizer's own count does not report.idstringA stable identity, or null to derive one from the tokenizer's type and
maxSequenceLength.
Exceptions
- ArgumentNullException
tokenizeris null.- ArgumentOutOfRangeException
maxSequenceLengthis not positive, orspecialTokenOverheadis negative.