make add_unk
optional and don't use it for ner
#2839
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
<unk>
token is a common practice to have a mechanism to add labels that are not common enough for training. This mainly relates to classification and basically simulates an "others" category.However, for NER, we have a different mechanism with the
O-tag
, hence I don't think<unk>
has any practical use.Using
<unk>
for NER can lead to down-weighting the overall score when the NER-model is not trained long enough (random apperances of<unk>
still happen. See (#2762 and #2761) and can break pipelines, that do not expect entities marked asunk
(#2224).I propose making the
<unk>
optional, per defaultTrue
, but allow disableling it for all ner-tasks. As well as disableling it at all ner-related examples.