RegexPreTokenizer(Regex, IReadOnlyDictionary<String,Int32>) 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 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 的字典。
例外狀況
當正則表達式為空時