Skip to content
Snippets Groups Projects
Commit ce0503c8 authored by Franck Dary's avatar Franck Dary
Browse files

Do not split for unknown tokens but replace instead

parent 28045459
No related branches found
No related tags found
No related merge requests found
......@@ -42,15 +42,10 @@ void ContextLSTMImpl::addToContext(std::vector<std::vector<long>> & context, Dic
for (auto & contextElement : context)
contextElement.push_back(dictIndex);
if (splitUnknown)
for (auto & targetCol : unknownValueColumns)
if (col == targetCol)
if (dict.getNbOccs(dictIndex) <= unknownValueThreshold)
{
context.emplace_back(context.back());
context.back().back() = dict.getIndexOrInsert(Dict::unknownValueStr);
}
for (auto & targetCol : unknownValueColumns)
if (col == targetCol)
if (dict.getNbOccs(dictIndex) <= unknownValueThreshold)
context.back().back() = dict.getIndexOrInsert(Dict::unknownValueStr);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment