This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
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.
Summary:
Pull Request resolved: #729
Add multi-label support to Pytext training workflow including
LabelListTensorizer to read label list
MultiLabelSoftMarginLoss with n_hot_encoding encoding to calculate the loss of multi-label task
(need to take care of the padded -1 in n_hot_encoding)
MultiLabelOutputLayer with predictions of all potential labels for each example
LabelListPrediction(NamedTuple) for an example including
MultiLabelClassificationMetricReporter
handle the label / label list inputs at the same time in channel.py
In input arguments, users are able to choose
define@register_adapter(from_version=12) v11_to_v12 in config_adapter.py to make ClassificationMetricReporter expansible
keep RECALL_AT_PRECISION_THREHOLDS as it was, users can change the values to test their data set (for example, add 0.7 into the list of thresholds)
It has been tested on single-label and multi-label examples for DocNN and BERT models
Differential Revision: D15777482