@@ -93,7 +93,7 @@ internal sealed class Options : TransformInputBase
93
93
public int SkipLength = NgramExtractingEstimator . Defaults . SkipLength ;
94
94
95
95
[ Argument ( ArgumentType . Multiple , HelpText = "Maximum number of ngrams to store in the dictionary" , ShortName = "max" ) ]
96
- public int [ ] MaxNumTerms = new int [ ] { NgramExtractingEstimator . Defaults . MaxNumTerms } ;
96
+ public int [ ] MaxNumTerms = new int [ ] { NgramExtractingEstimator . Defaults . MaximumTermCount } ;
97
97
98
98
[ Argument ( ArgumentType . AtMostOnce , HelpText = "The weighting criteria" ) ]
99
99
public NgramExtractingEstimator . WeightingCriteria Weighting = NgramExtractingEstimator . Defaults . Weighting ;
@@ -695,7 +695,7 @@ internal static class Defaults
695
695
public const int NgramLength = 2 ;
696
696
public const bool AllLengths = true ;
697
697
public const int SkipLength = 0 ;
698
- public const int MaxNumTerms = 10000000 ;
698
+ public const int MaximumTermCount = 10000000 ;
699
699
public const WeightingCriteria Weighting = WeightingCriteria . Tf ;
700
700
}
701
701
@@ -712,16 +712,16 @@ internal static class Defaults
712
712
/// <param name="ngramLength">Ngram length.</param>
713
713
/// <param name="skipLength">Maximum number of tokens to skip when constructing an ngram.</param>
714
714
/// <param name="allLengths">Whether to include all ngram lengths up to <paramref name="ngramLength"/> or only <paramref name="ngramLength"/>.</param>
715
- /// <param name="maxNumTerms ">Maximum number of ngrams to store in the dictionary.</param>
715
+ /// <param name="maximumTermCount ">Maximum number of ngrams to store in the dictionary.</param>
716
716
/// <param name="weighting">Statistical measure used to evaluate how important a word is to a document in a corpus.</param>
717
717
internal NgramExtractingEstimator ( IHostEnvironment env ,
718
718
string outputColumnName , string inputColumnName = null ,
719
719
int ngramLength = Defaults . NgramLength ,
720
720
int skipLength = Defaults . SkipLength ,
721
721
bool allLengths = Defaults . AllLengths ,
722
- int maxNumTerms = Defaults . MaxNumTerms ,
722
+ int maximumTermCount = Defaults . MaximumTermCount ,
723
723
WeightingCriteria weighting = Defaults . Weighting )
724
- : this ( env , new [ ] { ( outputColumnName , inputColumnName ?? outputColumnName ) } , ngramLength , skipLength , allLengths , maxNumTerms , weighting )
724
+ : this ( env , new [ ] { ( outputColumnName , inputColumnName ?? outputColumnName ) } , ngramLength , skipLength , allLengths , maximumTermCount , weighting )
725
725
{
726
726
}
727
727
@@ -734,16 +734,16 @@ internal NgramExtractingEstimator(IHostEnvironment env,
734
734
/// <param name="ngramLength">Ngram length.</param>
735
735
/// <param name="skipLength">Maximum number of tokens to skip when constructing an ngram.</param>
736
736
/// <param name="allLengths">Whether to include all ngram lengths up to <paramref name="ngramLength"/> or only <paramref name="ngramLength"/>.</param>
737
- /// <param name="maxNumTerms ">Maximum number of ngrams to store in the dictionary.</param>
737
+ /// <param name="maximumTermCount ">Maximum number of ngrams to store in the dictionary.</param>
738
738
/// <param name="weighting">Statistical measure used to evaluate how important a word is to a document in a corpus.</param>
739
739
internal NgramExtractingEstimator ( IHostEnvironment env ,
740
740
( string outputColumnName , string inputColumnName ) [ ] columns ,
741
741
int ngramLength = Defaults . NgramLength ,
742
742
int skipLength = Defaults . SkipLength ,
743
743
bool allLengths = Defaults . AllLengths ,
744
- int maxNumTerms = Defaults . MaxNumTerms ,
744
+ int maximumTermCount = Defaults . MaximumTermCount ,
745
745
WeightingCriteria weighting = Defaults . Weighting )
746
- : this ( env , columns . Select ( x => new ColumnOptions ( x . outputColumnName , x . inputColumnName , ngramLength , skipLength , allLengths , weighting , maxNumTerms ) ) . ToArray ( ) )
746
+ : this ( env , columns . Select ( x => new ColumnOptions ( x . outputColumnName , x . inputColumnName , ngramLength , skipLength , allLengths , weighting , maximumTermCount ) ) . ToArray ( ) )
747
747
{
748
748
}
749
749
@@ -823,14 +823,14 @@ public sealed class ColumnOptions
823
823
/// <param name="skipLength">Maximum number of tokens to skip when constructing an ngram.</param>
824
824
/// <param name="allLengths">Whether to store all ngram lengths up to ngramLength, or only ngramLength.</param>
825
825
/// <param name="weighting">The weighting criteria.</param>
826
- /// <param name="maxNumTerms ">Maximum number of ngrams to store in the dictionary.</param>
826
+ /// <param name="maximumTermCount ">Maximum number of ngrams to store in the dictionary.</param>
827
827
public ColumnOptions ( string name , string inputColumnName = null ,
828
828
int ngramLength = Defaults . NgramLength ,
829
829
int skipLength = Defaults . SkipLength ,
830
830
bool allLengths = Defaults . AllLengths ,
831
831
WeightingCriteria weighting = Defaults . Weighting ,
832
- int maxNumTerms = Defaults . MaxNumTerms )
833
- : this ( name , ngramLength , skipLength , allLengths , weighting , new int [ ] { maxNumTerms } , inputColumnName ?? name )
832
+ int maximumTermCount = Defaults . MaximumTermCount )
833
+ : this ( name , ngramLength , skipLength , allLengths , weighting , new int [ ] { maximumTermCount } , inputColumnName ?? name )
834
834
{
835
835
}
836
836
@@ -839,7 +839,7 @@ internal ColumnOptions(string name,
839
839
int skipLength ,
840
840
bool allLengths ,
841
841
WeightingCriteria weighting ,
842
- int [ ] maxNumTerms ,
842
+ int [ ] maximumTermCounts ,
843
843
string inputColumnName = null )
844
844
{
845
845
Name = name ;
@@ -857,16 +857,16 @@ internal ColumnOptions(string name,
857
857
var limits = new int [ ngramLength ] ;
858
858
if ( ! AllLengths )
859
859
{
860
- Contracts . CheckUserArg ( Utils . Size ( maxNumTerms ) == 0 ||
861
- Utils . Size ( maxNumTerms ) == 1 && maxNumTerms [ 0 ] > 0 , nameof ( maxNumTerms ) ) ;
862
- limits [ ngramLength - 1 ] = Utils . Size ( maxNumTerms ) == 0 ? Defaults . MaxNumTerms : maxNumTerms [ 0 ] ;
860
+ Contracts . CheckUserArg ( Utils . Size ( maximumTermCounts ) == 0 ||
861
+ Utils . Size ( maximumTermCounts ) == 1 && maximumTermCounts [ 0 ] > 0 , nameof ( maximumTermCounts ) ) ;
862
+ limits [ ngramLength - 1 ] = Utils . Size ( maximumTermCounts ) == 0 ? Defaults . MaximumTermCount : maximumTermCounts [ 0 ] ;
863
863
}
864
864
else
865
865
{
866
- Contracts . CheckUserArg ( Utils . Size ( maxNumTerms ) <= ngramLength , nameof ( maxNumTerms ) ) ;
867
- Contracts . CheckUserArg ( Utils . Size ( maxNumTerms ) == 0 || maxNumTerms . All ( i => i >= 0 ) && maxNumTerms [ maxNumTerms . Length - 1 ] > 0 , nameof ( maxNumTerms ) ) ;
868
- var extend = Utils . Size ( maxNumTerms ) == 0 ? Defaults . MaxNumTerms : maxNumTerms [ maxNumTerms . Length - 1 ] ;
869
- limits = Utils . BuildArray ( ngramLength , i => i < Utils . Size ( maxNumTerms ) ? maxNumTerms [ i ] : extend ) ;
866
+ Contracts . CheckUserArg ( Utils . Size ( maximumTermCounts ) <= ngramLength , nameof ( maximumTermCounts ) ) ;
867
+ Contracts . CheckUserArg ( Utils . Size ( maximumTermCounts ) == 0 || maximumTermCounts . All ( i => i >= 0 ) && maximumTermCounts [ maximumTermCounts . Length - 1 ] > 0 , nameof ( maximumTermCounts ) ) ;
868
+ var extend = Utils . Size ( maximumTermCounts ) == 0 ? Defaults . MaximumTermCount : maximumTermCounts [ maximumTermCounts . Length - 1 ] ;
869
+ limits = Utils . BuildArray ( ngramLength , i => i < Utils . Size ( maximumTermCounts ) ? maximumTermCounts [ i ] : extend ) ;
870
870
}
871
871
Limits = ImmutableArray . Create ( limits ) ;
872
872
}
0 commit comments