1 instantiation of NgramExtractingEstimator
Microsoft.ML.Transforms (1)
Text\WordBagTransform.cs (1)
538
return chain.Append<ITransformer>(new
NgramExtractingEstimator
(env, ngramColumns));
86 references to NgramExtractingEstimator
Microsoft.ML.Samples (4)
Dynamic\NgramExtraction.cs (2)
46
var
ngramOnePipeline = ml.Transforms.Text
49
var
ngramTwpPipeline = ml.Transforms.Text
Dynamic\Transforms\Text\ProduceNgrams.cs (1)
61
weighting:
NgramExtractingEstimator
.WeightingCriteria.Tf));
Dynamic\Transforms\Text\ProduceWordBags.cs (1)
58
weighting:
NgramExtractingEstimator
.WeightingCriteria.Tf);
Microsoft.ML.Tests (4)
OnnxConversionTest.cs (1)
1462
NgramExtractingEstimator
.WeightingCriteria weighting)
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
536
ngramLength: 3, weighting:
NgramExtractingEstimator
.WeightingCriteria.TfIdf))
Scenarios\WordBagTest.cs (2)
33
ngramLength: 3, useAllLengths: false, weighting:
NgramExtractingEstimator
.WeightingCriteria.Tf).Append(
35
ngramLength: 3, useAllLengths: false, weighting:
NgramExtractingEstimator
.WeightingCriteria.Tf));
Microsoft.ML.Transforms (78)
Text\NgramTransform.cs (27)
34
/// <see cref="ITransformer"/> resulting from fitting an <see cref="
NgramExtractingEstimator
"/>.
56
public
NgramExtractingEstimator
.WeightingCriteria? Weighting;
83
public int NgramLength =
NgramExtractingEstimator
.Defaults.NgramLength;
87
public bool UseAllLengths =
NgramExtractingEstimator
.Defaults.UseAllLengths;
92
public int SkipLength =
NgramExtractingEstimator
.Defaults.SkipLength;
95
public int[] MaxNumTerms = new int[] {
NgramExtractingEstimator
.Defaults.MaximumNgramsCount };
98
public
NgramExtractingEstimator
.WeightingCriteria Weighting =
NgramExtractingEstimator
.Defaults.Weighting;
129
public readonly
NgramExtractingEstimator
.WeightingCriteria Weighting;
131
public bool RequireIdf => Weighting ==
NgramExtractingEstimator
.WeightingCriteria.Idf || Weighting ==
NgramExtractingEstimator
.WeightingCriteria.TfIdf;
133
public TransformInfo(
NgramExtractingEstimator
.ColumnOptions info)
159
Weighting = (
NgramExtractingEstimator
.WeightingCriteria)ctx.Reader.ReadInt32();
160
Contracts.CheckDecode(Enum.IsDefined(typeof(
NgramExtractingEstimator
.WeightingCriteria), Weighting));
179
Contracts.Assert(Enum.IsDefined(typeof(
NgramExtractingEstimator
.WeightingCriteria), Weighting));
194
private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(
NgramExtractingEstimator
.ColumnOptions[] columns)
203
if (!
NgramExtractingEstimator
.IsColumnTypeValid(type))
204
throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName,
NgramExtractingEstimator
.ExpectedColumnType, type.ToString());
207
internal NgramExtractingTransformer(IHostEnvironment env, IDataView input,
NgramExtractingEstimator
.ColumnOptions[] columns)
221
private static SequencePool[] Train(IHostEnvironment env,
NgramExtractingEstimator
.ColumnOptions[] columns, ImmutableArray<TransformInfo> transformInfos, IDataView trainingData, out double[][] invDocFreqs)
416
var cols = new
NgramExtractingEstimator
.ColumnOptions[options.Columns.Length];
424
cols[i] = new
NgramExtractingEstimator
.ColumnOptions(
687
case
NgramExtractingEstimator
.WeightingCriteria.TfIdf:
704
case
NgramExtractingEstimator
.WeightingCriteria.Idf:
721
case
NgramExtractingEstimator
.WeightingCriteria.Tf:
811
mode = transformInfo.Weighting ==
NgramExtractingEstimator
.WeightingCriteria.Idf ? "IDF" : "TFIDF";
949
_host = env.Register(nameof(
NgramExtractingEstimator
));
Text\TextCatalog.cs (27)
246
/// Creates a <see cref="
NgramExtractingEstimator
"/> which produces a vector of counts of n-grams (sequences of consecutive words)
268
public static
NgramExtractingEstimator
ProduceNgrams(this TransformsCatalog.TextTransforms catalog,
271
int ngramLength =
NgramExtractingEstimator
.Defaults.NgramLength,
272
int skipLength =
NgramExtractingEstimator
.Defaults.SkipLength,
273
bool useAllLengths =
NgramExtractingEstimator
.Defaults.UseAllLengths,
274
int maximumNgramsCount =
NgramExtractingEstimator
.Defaults.MaximumNgramsCount,
275
NgramExtractingEstimator
.WeightingCriteria weighting =
NgramExtractingEstimator
.Defaults.Weighting) =>
286
internal static
NgramExtractingEstimator
ProduceNgrams(this TransformsCatalog.TextTransforms catalog,
287
params
NgramExtractingEstimator
.ColumnOptions[] columns)
341
/// <see cref="WordBagEstimator"/> is different from <see cref="
NgramExtractingEstimator
"/> in that the former
357
int ngramLength =
NgramExtractingEstimator
.Defaults.NgramLength,
358
int skipLength =
NgramExtractingEstimator
.Defaults.SkipLength,
359
bool useAllLengths =
NgramExtractingEstimator
.Defaults.UseAllLengths,
360
int maximumNgramsCount =
NgramExtractingEstimator
.Defaults.MaximumNgramsCount,
361
NgramExtractingEstimator
.WeightingCriteria weighting =
NgramExtractingEstimator
.WeightingCriteria.Tf)
370
/// <see cref="WordBagEstimator"/> is different from <see cref="
NgramExtractingEstimator
"/> in that the former
386
int maximumNgramsCount =
NgramExtractingEstimator
.Defaults.MaximumNgramsCount)
388
outputColumnName, inputColumnName, 1, 0, true, maximumNgramsCount,
NgramExtractingEstimator
.WeightingCriteria.Tf, termSeparator: termSeparator, freqSeparator: freqSeparator);
395
/// <see cref="WordBagEstimator"/> is different from <see cref="
NgramExtractingEstimator
"/> in that the former
411
int ngramLength =
NgramExtractingEstimator
.Defaults.NgramLength,
412
int skipLength =
NgramExtractingEstimator
.Defaults.SkipLength,
413
bool useAllLengths =
NgramExtractingEstimator
.Defaults.UseAllLengths,
414
int maximumNgramsCount =
NgramExtractingEstimator
.Defaults.MaximumNgramsCount,
415
NgramExtractingEstimator
.WeightingCriteria weighting =
NgramExtractingEstimator
.WeightingCriteria.Tf)
Text\WordBagTransform.cs (10)
75
public
NgramExtractingEstimator
.WeightingCriteria? Weighting;
379
public
NgramExtractingEstimator
.WeightingCriteria? Weighting;
415
public int SkipLength =
NgramExtractingEstimator
.Defaults.SkipLength;
420
public bool UseAllLengths =
NgramExtractingEstimator
.Defaults.UseAllLengths;
423
public int[] MaxNumTerms = new int[] {
NgramExtractingEstimator
.Defaults.MaximumNgramsCount };
426
public
NgramExtractingEstimator
.WeightingCriteria Weighting =
NgramExtractingEstimator
.Defaults.Weighting;
501
termLoaderArgs == null ?
NgramExtractingEstimator
.Defaults.MaximumNgramsCount : int.MaxValue,
525
var ngramColumns = new
NgramExtractingEstimator
.ColumnOptions[options.Columns.Length];
529
ngramColumns[iinfo] = new
NgramExtractingEstimator
.ColumnOptions(column.Name,
Text\WrappedTextTransformers.cs (14)
37
/// <seealso cref="TextCatalog.ProduceWordBags(TransformsCatalog.TextTransforms, string, string, int, int, bool, int,
NgramExtractingEstimator
.WeightingCriteria)" />
38
/// <seealso cref="TextCatalog.ProduceWordBags(TransformsCatalog.TextTransforms, string, string[], int, int, bool, int,
NgramExtractingEstimator
.WeightingCriteria)" />
47
private readonly
NgramExtractingEstimator
.WeightingCriteria _weighting;
80
public
NgramExtractingEstimator
.WeightingCriteria Weighting;
85
SkipLength =
NgramExtractingEstimator
.Defaults.SkipLength;
86
UseAllLengths =
NgramExtractingEstimator
.Defaults.UseAllLengths;
87
MaximumNgramsCount = new int[] {
NgramExtractingEstimator
.Defaults.MaximumNgramsCount };
88
Weighting =
NgramExtractingEstimator
.Defaults.Weighting;
113
NgramExtractingEstimator
.WeightingCriteria weighting =
NgramExtractingEstimator
.WeightingCriteria.Tf,
141
NgramExtractingEstimator
.WeightingCriteria weighting =
NgramExtractingEstimator
.WeightingCriteria.Tf,
167
NgramExtractingEstimator
.WeightingCriteria weighting =
NgramExtractingEstimator
.WeightingCriteria.Tf,