Skip to content

Commit 758e3fc

Browse files
committed
Rename NgramHashing's static API again
1 parent dd4477a commit 758e3fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Microsoft.ML.StaticPipe/TextStaticExtensions.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ public override IEstimator<ITransformer> Reconcile(IHostEnvironment env,
571571
/// Produces a bag of counts of ngrams (sequences of consecutive words of length 1-n) in a given tokenized text.
572572
/// It does so by hashing each ngram and using the hash value as the index in the bag.
573573
///
574-
/// <see cref="ApplyNgramHashing"/> is different from <see cref="WordHashBagEstimatorStaticExtensions.ToBagofHashedWords"/>
575-
/// in a way that <see cref="ApplyNgramHashing"/> takes tokenized text as input while <see cref="WordHashBagEstimatorStaticExtensions.ToBagofHashedWords"/> tokenizes text internally.
574+
/// <see cref="ProduceHashedNgrams"/> is different from <see cref="WordHashBagEstimatorStaticExtensions.ToBagofHashedWords"/>
575+
/// in a way that <see cref="ProduceHashedNgrams"/> takes tokenized text as input while <see cref="WordHashBagEstimatorStaticExtensions.ToBagofHashedWords"/> tokenizes text internally.
576576
/// </summary>
577577
/// <param name="input">The column to apply to.</param>
578578
/// <param name="numberOfBits">Number of bits to hash into. Must be between 1 and 30, inclusive.</param>
@@ -585,7 +585,7 @@ public override IEstimator<ITransformer> Reconcile(IHostEnvironment env,
585585
/// Text representation of original values are stored in the slot names of the metadata for the new column.Hashing, as such, can map many initial values to one.
586586
/// <paramref name="invertHash"/> specifies the upper bound of the number of distinct input values mapping to a hash that should be retained.
587587
/// <value>0</value> does not retain any input values. <value>-1</value> retains all input values mapping to each hash.</param>
588-
public static Vector<float> ApplyNgramHashing(this VarVector<Key<uint, string>> input,
588+
public static Vector<float> ProduceHashedNgrams(this VarVector<Key<uint, string>> input,
589589
int numberOfBits = 16,
590590
int ngramLength = 2,
591591
int skipLength = 0,

test/Microsoft.ML.StaticPipelineTesting/StaticPipeTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ public void Ngrams()
605605
.Append(r => (
606606
r.label,
607607
ngrams: r.text.TokenizeText().ToKey().ProduceNgrams(),
608-
ngramshash: r.text.TokenizeText().ToKey().ApplyNgramHashing()));
608+
ngramshash: r.text.TokenizeText().ToKey().ProduceHashedNgrams()));
609609

610610
var tdata = est.Fit(data).Transform(data);
611611
var schema = tdata.AsDynamic.Schema;

0 commit comments

Comments
 (0)