1 write to Tokenizer
Microsoft.ML.TorchSharp (1)
NasBert\NasBertTrainer.cs (1)
203
Tokenizer
= TokenizerExtensions.GetInstance(ch);
7 references to Tokenizer
Microsoft.ML.TorchSharp (7)
NasBert\NasBertTrainer.cs (5)
204
EnglishRobertaTokenizer tokenizerModel =
Tokenizer
.RobertaModel();
240
return DataUtils.CollateTokens(inputTensors,
Tokenizer
.RobertaModel().PadIndex, device: Device);
250
t = torch.tensor((new[] { 0 /* InitToken */ }).Concat(
Tokenizer
.EncodeToConverted(sentence1.ToString())).ToList(), device: Device);
258
t = torch.tensor((new[] { 0 /* InitToken */ }).Concat(
Tokenizer
.EncodeToConverted(sentence1.ToString()))
259
.Concat(new[] { 2 /* SeparatorToken */ }).Concat(
Tokenizer
.EncodeToConverted(sentence2.ToString())).ToList(), device: Device);
NasBert\NerTrainer.cs (2)
170
IReadOnlyList<EncodedToken> encoding =
Tokenizer
.EncodeToTokens(sentence, out string normalizedText);
190
t = torch.tensor((ZeroArray).Concat(
Tokenizer
.RobertaModel().ConvertIdsToOccurrenceRanks(encoding.Select(t => t.Id).ToArray())).ToList(), device: Device);