FeaturizeText was upgraded to allow specification of n-grams for words and characters. However, now it awkward to use FeaturizeTextwithout specifying n-grams. It is now necessary to explicitly set CharFeatureExtractor as null.
This is how to compose a bag-of-words with the current API:
varpipeline=mlContext.Transforms.Text.FeaturizeText("Features",newTextFeaturizingEstimator.Options{KeepPunctuations=false,OutputTokens=true,CharFeatureExtractor=null,WordFeatureExtractor=newWordBagEstimator.Options{NgramLength=1},VectorNormalizer=TextFeaturizingEstimator.NormFunction.None},"SentimentText");I would expect to be able to do something like
CharFeatureExtractor=newWordBagEstimator.Options{NgramLength=0},But this throws an error that Skipgrams is not less-than NgramLength, and Skipgrams must be positive.
Overall, it is a bit awkward and not obvious that you have to manually null a option. Is this the API we want to ship in v1.0?
FeaturizeTextwas upgraded to allow specification of n-grams for words and characters. However, now it awkward to useFeaturizeTextwithout specifying n-grams. It is now necessary to explicitly setCharFeatureExtractorasnull.This is how to compose a bag-of-words with the current API:
I would expect to be able to do something like
But this throws an error that
Skipgramsis not less-thanNgramLength, andSkipgramsmust be positive.Overall, it is a bit awkward and not obvious that you have to manually null a option. Is this the API we want to ship in v1.0?