Skip to content
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