You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a complex multilabel classification task. The label space is approximately 13000 labels (specifically a subset of the Human Phenotype Ontology).
The task it to classify sentences with zero or more labels. About 5% of the corpus has zero labels, 75% has one label, and 20% has more than one label.
I installed flair from master today (20 July 2022).
If I train a single label model using TextClassifer, it works pretty well, with an ultimate F1 of about 0.8.
I also read that user collinpu reported that they "used a large positive pos_weight vector to bias the model away from predicting all nulls". However, there doesn't seem to be any supported way to specify pos_weight.
Does anyone have any ideas on how to get multilabel training to work for TextClassifer?
The text was updated successfully, but these errors were encountered:
if I understand the pos_weight correctly, there is no reason to choose the weight over the pos_weight in a multi label setting?
If so, you can set the weights when creating the Classifier and then overwrite the loss function after creating the text classifier:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a complex multilabel classification task. The label space is approximately 13000 labels (specifically a subset of the Human Phenotype Ontology).
The task it to classify sentences with zero or more labels. About 5% of the corpus has zero labels, 75% has one label, and 20% has more than one label.
I installed
flair
frommaster
today (20 July 2022).If I train a single label model using
TextClassifer
, it works pretty well, with an ultimate F1 of about 0.8.The training shows consistent improvements with early epochs.
However, if I change to a
multi_label = True
TextClassifier
, I can't get the model to train at all.The model starts off predicting many thousands of labels per sentence, and then settles on predicting no labels per sentence.
I've tried many possible values of
multi_label_threshold
, but the result is ultimately the same.The problem sounds very similar to that described in Issue #678.
I see that there was a commit that implemented
BCEWithLogitsLoss()
, but the issue persists.I also read that user collinpu reported that they "used a large positive pos_weight vector to bias the model away from predicting all nulls". However, there doesn't seem to be any supported way to specify
pos_weight
.Does anyone have any ideas on how to get multilabel training to work for
TextClassifer
?The text was updated successfully, but these errors were encountered: