3 writes to SpecialTokens
Microsoft.ML.Tokenizers (2)
Model\BertTokenizer.cs (2)
773
options.
SpecialTokens
= dic;
791
options.
SpecialTokens
= specialTokens;
Microsoft.ML.Tokenizers.Tests (1)
WordPieceTests.cs (1)
188
WordPieceTokenizer tokenizer = WordPieceTokenizer.Create(vocabFile, new WordPieceOptions {
SpecialTokens
= specialTokens });
8 references to SpecialTokens
Microsoft.ML.Tokenizers (8)
Model\BertTokenizer.cs (4)
768
if (options.
SpecialTokens
is not null)
772
Dictionary<string, int> dic = options.
SpecialTokens
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
775
foreach (var kvp in options.
SpecialTokens
)
801
options.PreTokenizer ??= options.ApplyBasicTokenization ? PreTokenizer.CreateWordOrPunctuation(options.SplitOnSpecialTokens ? options.
SpecialTokens
: null) : PreTokenizer.CreateWhiteSpace();
Model\WordPieceTokenizer.cs (4)
44
SpecialTokens = options.
SpecialTokens
;
45
SpecialTokensReverse = options.
SpecialTokens
is not null ? options.
SpecialTokens
.ToDictionary(kvp => kvp.Value, kvp => kvp.Key) : null;
72
_preTokenizer = options.PreTokenizer ?? PreTokenizer.CreateWhiteSpace(options.
SpecialTokens
);