BpeTrainer 类

定义

负责训练 Bpe 模型的 Bpe 训练器。

public sealed class BpeTrainer : Microsoft.ML.Tokenizers.Trainer
type BpeTrainer = class
    inherit Trainer
Public NotInheritable Class BpeTrainer
Inherits Trainer
继承
BpeTrainer

构造函数

BpeTrainer()

使用默认值构造新的 BpeTrainer 对象。

BpeTrainer(IEnumerable<AddedToken>, Int32, Int32, ReportProgress, Nullable<Int32>, HashSet<Char>, String, String)

构造新的 BpeTrainer 对象。

属性

ContinuingSubwordPrefix

获取要用于不是词首的每个子词的前缀。

EndOfWordSuffix

获取要用于作为词尾的每个子单词的后缀。

InitialAlphabet

获取要包含在初始字母表中的字符列表,即使训练数据集中未显示也是如此。 如果字符串包含多个字符,则仅保留第一个字符。

LimitAlphabet

获取字母表中要保留的最大不同字符。

MinFrequency

获取一对为了合并而应具有的最小频率。

Progress

在训练期间需要报告进度时设置。

(继承自 Trainer)
SpecialTokens

获取模型应知道的特殊标记的列表。

VocabSize

获取最终词汇的大小,包括所有标记和字母表。

方法

Feed(IEnumerable<String>, Func<String,IEnumerable<String>>)

处理输入序列并将结果馈送给模型。

Train(Model)

执行实际训练,并使用新词汇更新输入模型并合并数据。

适用于