Example #1
0
        public static CommonOutputs.TransformOutput TextTransform(IHostEnvironment env, TextFeaturizingEstimator.Arguments input)
        {
            var h  = EntryPointUtils.CheckArgsAndCreateHost(env, "FeaturizeTextEstimator", input);
            var xf = TextFeaturizingEstimator.Create(h, input, input.Data);

            return(new CommonOutputs.TransformOutput()
            {
                Model = new TransformModelImpl(h, xf, input.Data),
                OutputData = xf
            });
        }
Example #2
0
 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.CaseMode));
     WordExtractorFactory = parent._wordFeatureExtractor?.CreateComponent(host, parent._dictionary);
     CharExtractorFactory = parent._charFeatureExtractor?.CreateComponent(host, parent._dictionary);
     Norm = parent.OptionalSettings.Norm;
     Language = parent.OptionalSettings.Language;
     UsePredefinedStopWordRemover = parent.OptionalSettings.UsePredefinedStopWordRemover;
     TextCase = parent.OptionalSettings.CaseMode;
     KeepDiacritics = parent.OptionalSettings.KeepDiacritics;
     KeepPunctuations = parent.OptionalSettings.KeepPunctuations;
     KeepNumbers = parent.OptionalSettings.KeepNumbers;
     OutputTextTokens = parent.OptionalSettings.OutputTokens;
     Dictionary = parent._dictionary;
 }
            public TransformApplierParams(TextFeaturizingEstimator parent)
            {
                var host = parent._host;

                host.Check(Enum.IsDefined(typeof(Language), parent.AdvancedSettings.TextLanguage));
                host.Check(Enum.IsDefined(typeof(CaseNormalizationMode), parent.AdvancedSettings.TextCase));
                WordExtractorFactory = parent._wordFeatureExtractor?.CreateComponent(host, parent._dictionary);
                CharExtractorFactory = parent._charFeatureExtractor?.CreateComponent(host, parent._dictionary);
                VectorNormalizer     = parent.AdvancedSettings.VectorNormalizer;
                Language             = parent.AdvancedSettings.TextLanguage;
                StopWordsRemover     = parent._stopWordsRemover;
                TextCase             = parent.AdvancedSettings.TextCase;
                KeepDiacritics       = parent.AdvancedSettings.KeepDiacritics;
                KeepPunctuations     = parent.AdvancedSettings.KeepPunctuations;
                KeepNumbers          = parent.AdvancedSettings.KeepNumbers;
                OutputTextTokens     = parent.AdvancedSettings.OutputTokens;
                Dictionary           = parent._dictionary;
            }