TextCatalog.ProduceWordBags 方法

定義

多載

ProduceWordBags(TransformsCatalog+TextTransforms, String, Char, Char, String, Int32)

建立 WordBagEstimator,其會將 中指定的 inputColumnName 數據行對應至名為 outputColumnName的新數據行中 n-gram 計數的向量。

ProduceWordBags(TransformsCatalog+TextTransforms, String, String, Int32, Int32, Boolean, Int32, NgramExtractingEstimator+WeightingCriteria)

建立 WordBagEstimator,其會將 中指定的 inputColumnName 數據行對應至名為 outputColumnName的新數據行中 n-gram 計數的向量。

ProduceWordBags(TransformsCatalog+TextTransforms, String, String[], Int32, Int32, Boolean, Int32, NgramExtractingEstimator+WeightingCriteria)

建立 WordBagEstimator,其會將 中指定的 inputColumnNames 多個數據行對應至名為 outputColumnName的新數據行中 n-gram 計數的向量。

ProduceWordBags(TransformsCatalog+TextTransforms, String, Char, Char, String, Int32)

來源:
TextCatalog.cs
來源:
TextCatalog.cs
來源:
TextCatalog.cs

建立 WordBagEstimator,其會將 中指定的 inputColumnName 數據行對應至名為 outputColumnName的新數據行中 n-gram 計數的向量。

C#
public static Microsoft.ML.Transforms.Text.WordBagEstimator ProduceWordBags(this Microsoft.ML.TransformsCatalog.TextTransforms catalog, string outputColumnName, char termSeparator, char freqSeparator, string inputColumnName = default, int maximumNgramsCount = 10000000);

參數

catalog
TransformsCatalog.TextTransforms

轉換的目錄。

outputColumnName
String

轉換所產生的 inputColumnName資料行名稱。 此數據行的數據類型將是的 Single已知大小向量。

termSeparator
Char
freqSeparator
Char
inputColumnName
String

要從中擷取數據的數據行名稱。 要儲存在字典中的 n-gram 數目上限。用來分隔字詞/頻率組的分隔符。用來分隔詞彙與其頻率的分隔符。 此估算器會透過文字向量運作。

maximumNgramsCount
Int32

傳回

備註

WordBagEstimator 不同於 NgramExtractingEstimator 先前在內部標記化文字,後者則會採用標記化文字作為輸入。

適用於

ML.NET Preview 及其他版本
產品 版本
ML.NET 2.0.0, 3.0.0, 4.0.0, Preview

ProduceWordBags(TransformsCatalog+TextTransforms, String, String, Int32, Int32, Boolean, Int32, NgramExtractingEstimator+WeightingCriteria)

來源:
TextCatalog.cs
來源:
TextCatalog.cs
來源:
TextCatalog.cs

建立 WordBagEstimator,其會將 中指定的 inputColumnName 數據行對應至名為 outputColumnName的新數據行中 n-gram 計數的向量。

C#
public static Microsoft.ML.Transforms.Text.WordBagEstimator ProduceWordBags(this Microsoft.ML.TransformsCatalog.TextTransforms catalog, string outputColumnName, string inputColumnName = default, int ngramLength = 2, int skipLength = 0, bool useAllLengths = true, int maximumNgramsCount = 10000000, Microsoft.ML.Transforms.Text.NgramExtractingEstimator.WeightingCriteria weighting = Microsoft.ML.Transforms.Text.NgramExtractingEstimator+WeightingCriteria.Tf);

參數

catalog
TransformsCatalog.TextTransforms

轉換的目錄。

outputColumnName
String

轉換所產生的 inputColumnName資料行名稱。 此數據行的數據類型將是的 Single已知大小向量。

inputColumnName
String

要從中擷取數據的數據行名稱。 此估算器會透過文字向量運作。

ngramLength
Int32

Ngram 長度。

skipLength
Int32

建構 n-gram 時要略過的令牌數目上限。

useAllLengths
Boolean

是否要包含所有 n-gram 長度,最多 ngramLength 或只 ngramLength包含 。

maximumNgramsCount
Int32

要儲存在字典中的 n-gram 數目上限。

weighting
NgramExtractingEstimator.WeightingCriteria

統計量值,用來評估單字對主體中的檔有多重要。

傳回

備註

WordBagEstimator 不同於 NgramExtractingEstimator 先前在內部標記化文字,後者則會採用標記化文字作為輸入。

適用於

ML.NET Preview 及其他版本
產品 版本
ML.NET 1.0.0, 1.1.0, 1.2.0, 1.3.1, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 2.0.0, 3.0.0, 4.0.0, Preview

ProduceWordBags(TransformsCatalog+TextTransforms, String, String[], Int32, Int32, Boolean, Int32, NgramExtractingEstimator+WeightingCriteria)

來源:
TextCatalog.cs
來源:
TextCatalog.cs
來源:
TextCatalog.cs

建立 WordBagEstimator,其會將 中指定的 inputColumnNames 多個數據行對應至名為 outputColumnName的新數據行中 n-gram 計數的向量。

C#
public static Microsoft.ML.Transforms.Text.WordBagEstimator ProduceWordBags(this Microsoft.ML.TransformsCatalog.TextTransforms catalog, string outputColumnName, string[] inputColumnNames, int ngramLength = 2, int skipLength = 0, bool useAllLengths = true, int maximumNgramsCount = 10000000, Microsoft.ML.Transforms.Text.NgramExtractingEstimator.WeightingCriteria weighting = Microsoft.ML.Transforms.Text.NgramExtractingEstimator+WeightingCriteria.Tf);

參數

catalog
TransformsCatalog.TextTransforms

轉換的目錄。

outputColumnName
String

轉換所產生的 inputColumnNames資料行名稱。 此數據行的數據類型將是的 Single已知大小向量。

inputColumnNames
String[]

要從中擷取數據的多個數據行名稱。 此估算器會透過文字向量運作。

ngramLength
Int32

Ngram 長度。

skipLength
Int32

建構 n-gram 時要略過的令牌數目上限。

useAllLengths
Boolean

是否要包含所有 n-gram 長度,最多 ngramLength 或只 ngramLength包含 。

maximumNgramsCount
Int32

要儲存在字典中的 n-gram 數目上限。

weighting
NgramExtractingEstimator.WeightingCriteria

統計量值,用來評估單字對主體中的檔有多重要。

傳回

備註

WordBagEstimator 不同於 NgramExtractingEstimator 先前在內部標記化文字,後者則會採用標記化文字作為輸入。

適用於

ML.NET Preview 及其他版本
產品 版本
ML.NET 1.0.0, 1.1.0, 1.2.0, 1.3.1, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 2.0.0, 3.0.0, 4.0.0, Preview