Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Spelling on stopwords #5524

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Microsoft.ML.Transforms/Text/StopWordsRemovingTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ private CustomStopWordsRemovingTransformer(IHost host, ModelLoadContext ctx) :
{

const string dir = "Stopwords";
NormStr.Pool stopwrods = null;
NormStr.Pool stopwords = null;
bool res = ctx.TryProcessSubModel(dir,
c =>
{
Expand All @@ -997,22 +997,22 @@ private CustomStopWordsRemovingTransformer(IHost host, ModelLoadContext ctx) :
int cstr = ctx.Reader.ReadInt32();
Host.CheckDecode(cstr > 0);

stopwrods = new NormStr.Pool();
stopwords = new NormStr.Pool();
for (int istr = 0; istr < cstr; istr++)
{
var nstr = stopwrods.Add(ctx.LoadString());
var nstr = stopwords.Add(ctx.LoadString());
Host.CheckDecode(nstr.Id == istr);
}

// All stopwords are distinct.
Host.CheckDecode(stopwrods.Count == cstr);
Host.CheckDecode(stopwords.Count == cstr);
// The deserialized pool should not have the empty string.
Host.CheckDecode(stopwrods.Get("") == null);
Host.CheckDecode(stopwords.Get("") == null);
});
if (!res)
throw Host.ExceptDecode();

_stopWordsMap = stopwrods;
_stopWordsMap = stopwords;
}
}

Expand Down