語言

RegexPreTokenizer(Regex, IReadOnlyDictionary<String,Int32>) 建構函式

定義

初始化 RegexPreTokenizer 類別的新執行個體。

public RegexPreTokenizer(System.Text.RegularExpressions.Regex regex, System.Collections.Generic.IReadOnlyDictionary<string,int>? specialTokens);
new Microsoft.ML.Tokenizers.RegexPreTokenizer : System.Text.RegularExpressions.Regex * System.Collections.Generic.IReadOnlyDictionary<string, int> -> Microsoft.ML.Tokenizers.RegexPreTokenizer
Public Sub New (regex As Regex, specialTokens As IReadOnlyDictionary(Of String, Integer))

參數

regex
Regex

正則表達式用於在分詞化前將文字拆分成較小的標記。

specialTokens
IReadOnlyDictionary<String,Int32>

包含特殊標記及其對應 ID 的字典。

例外狀況

當正則表達式為空時

適用於