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