語言

BpeTrainer 類別

定義

負責訓練 Bpe 模型的 Bpe 訓練師。

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

建構函式

名稱 Description
BpeTrainer()

用預設值建構一個新的 BpeTrainer 物件。

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

建立一個新的 BpeTrainer 物件。

屬性

名稱 Description
ContinuingSubwordPrefix

取得用於所有非詞首子詞的前綴。

EndOfWordSuffix

讓每個子詞的詞尾都用在後綴。

InitialAlphabet

取得初始字母表中要包含的字元列表,即使訓練資料集中沒有看到。 若字串包含多個字元,則只保留第一個字元。

LimitAlphabet

能在字母表中保留最多不同的字元。

MinFrequency

取得一對應有的最低頻率以便合併。

Progress

設定何時需要在培訓期間報告進度。

(繼承來源 Trainer)
SpecialTokens

取得模型應該知道的特殊標記清單。

VocabSize

取得最終詞彙的大小,包括所有詞號和字母表。

方法

名稱 Description
Feed(IEnumerable<String>, Func<String,IEnumerable<String>>)

處理輸入序列並將結果輸入模型。

Train(Model)

執行實際訓練,並用新詞彙更新輸入模型,並合併資料。

適用於