diff --git a/src/Microsoft.ML.Transforms/Text/TextFeaturizingEstimator.cs b/src/Microsoft.ML.Transforms/Text/TextFeaturizingEstimator.cs index d7cca7752a..c8d87fa3a0 100644 --- a/src/Microsoft.ML.Transforms/Text/TextFeaturizingEstimator.cs +++ b/src/Microsoft.ML.Transforms/Text/TextFeaturizingEstimator.cs @@ -99,8 +99,8 @@ public sealed class Options : TransformInputBase [Argument(ArgumentType.Multiple, HelpText = "Use stop remover or not.", ShortName = "remover", SortOrder = 4)] public bool UsePredefinedStopWordRemover = false; - [Argument(ArgumentType.AtMostOnce, HelpText = "Casing text using the rules of the invariant culture.", ShortName = "case", SortOrder = 5)] - public CaseMode TextCase = TextNormalizingEstimator.Defaults.Mode; + [Argument(ArgumentType.AtMostOnce, HelpText = "Casing text using the rules of the invariant culture.", Name="TextCase", ShortName = "case", SortOrder = 5)] + public CaseMode CaseMode = TextNormalizingEstimator.Defaults.Mode; [Argument(ArgumentType.AtMostOnce, HelpText = "Whether to keep diacritical marks or remove them.", ShortName = "diac", SortOrder = 6)] public bool KeepDiacritics = TextNormalizingEstimator.Defaults.KeepDiacritics; @@ -181,8 +181,8 @@ public WordBagEstimator.Options CharFeatureExtractor } } - [Argument(ArgumentType.AtMostOnce, HelpText = "Normalize vectors (rows) individually by rescaling them to unit norm.", ShortName = "norm", SortOrder = 13)] - public NormFunction VectorNormalizer = NormFunction.L2; + [Argument(ArgumentType.AtMostOnce, HelpText = "Normalize vectors (rows) individually by rescaling them to unit norm.", Name = "VectorNormalizer", ShortName = "norm", SortOrder = 13)] + public NormFunction Norm = NormFunction.L2; public Options() { @@ -193,7 +193,7 @@ public Options() internal readonly string OutputColumn; private readonly string[] _inputColumns; - internal IReadOnlyCollection InputColumns => _inputColumns.AsReadOnly(); + private IReadOnlyCollection InputColumns => _inputColumns.AsReadOnly(); internal Options OptionalSettings { get; } // These parameters are hardcoded for now. @@ -288,13 +288,13 @@ public TransformApplierParams(TextFeaturizingEstimator parent) { var host = parent._host; host.Check(Enum.IsDefined(typeof(Language), parent.OptionalSettings.Language)); - host.Check(Enum.IsDefined(typeof(CaseMode), parent.OptionalSettings.TextCase)); + host.Check(Enum.IsDefined(typeof(CaseMode), parent.OptionalSettings.CaseMode)); WordExtractorFactory = parent._wordFeatureExtractor?.CreateComponent(host, parent._dictionary); CharExtractorFactory = parent._charFeatureExtractor?.CreateComponent(host, parent._dictionary); - VectorNormalizer = parent.OptionalSettings.VectorNormalizer; + VectorNormalizer = parent.OptionalSettings.Norm; Language = parent.OptionalSettings.Language; UsePredefinedStopWordRemover = parent.OptionalSettings.UsePredefinedStopWordRemover; - TextCase = parent.OptionalSettings.TextCase; + TextCase = parent.OptionalSettings.CaseMode; KeepDiacritics = parent.OptionalSettings.KeepDiacritics; KeepPunctuations = parent.OptionalSettings.KeepPunctuations; KeepNumbers = parent.OptionalSettings.KeepNumbers; @@ -545,7 +545,7 @@ public SchemaShape GetOutputSchema(SchemaShape inputSchema) var metadata = new List(2); metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.SlotNames, SchemaShape.Column.VectorKind.Vector, TextDataViewType.Instance, false)); - if (OptionalSettings.VectorNormalizer != NormFunction.None) + if (OptionalSettings.Norm != NormFunction.None) metadata.Add(new SchemaShape.Column(AnnotationUtils.Kinds.IsNormalized, SchemaShape.Column.VectorKind.Scalar, BooleanDataViewType.Instance, false)); result[OutputColumn] = new SchemaShape.Column(OutputColumn, SchemaShape.Column.VectorKind.Vector, NumberDataViewType.Single, false, diff --git a/test/Microsoft.ML.Benchmarks/StochasticDualCoordinateAscentClassifierBench.cs b/test/Microsoft.ML.Benchmarks/StochasticDualCoordinateAscentClassifierBench.cs index 622023463a..8f20941e70 100644 --- a/test/Microsoft.ML.Benchmarks/StochasticDualCoordinateAscentClassifierBench.cs +++ b/test/Microsoft.ML.Benchmarks/StochasticDualCoordinateAscentClassifierBench.cs @@ -99,7 +99,7 @@ public void TrainSentiment() OutputTokens = true, KeepPunctuations = false, UsePredefinedStopWordRemover = true, - VectorNormalizer = TextFeaturizingEstimator.NormFunction.None, + Norm = TextFeaturizingEstimator.NormFunction.None, CharFeatureExtractor = null, WordFeatureExtractor = null, }, "SentimentText").Fit(loader).Transform(loader); diff --git a/test/Microsoft.ML.Functional.Tests/DataTransformation.cs b/test/Microsoft.ML.Functional.Tests/DataTransformation.cs index 50d4a38f63..21db727b8a 100644 --- a/test/Microsoft.ML.Functional.Tests/DataTransformation.cs +++ b/test/Microsoft.ML.Functional.Tests/DataTransformation.cs @@ -140,7 +140,7 @@ void ExtensibilityModifyTextFeaturization() { CharFeatureExtractor = new WordBagEstimator.Options() { NgramLength = 3, UseAllLengths = false }, WordFeatureExtractor = new WordBagEstimator.Options(), - VectorNormalizer = TextFeaturizingEstimator.NormFunction.L1 + Norm = TextFeaturizingEstimator.NormFunction.L1 }, "SentimentText") .AppendCacheCheckpoint(mlContext) .Append(mlContext.BinaryClassification.Trainers.SdcaCalibrated(