Skip to content
Discussion options

You must be logged in to vote

There's no way to add constraints like that to a textcat model. There are a couple of different ways you can model it instead.

To be clear, are these opposed labels strictly binary, in that a document is always one or the other? Or can a document be neither of them?

Assuming that they are strictly binary, you could train a non-exclusive multilabel model with only the positive variants, and then the probability of the negative label would be 1 - positive prob.

You could also train a textcat_multilabel model with all the labels, and instead of using a simple threshold, take the higher value from the opposed pairs as positive and the other as negative. That could be implemented as a simple c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Souheil-b
Comment options

Answer selected by Souheil-b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / textcat Feature: Text Classifier
2 participants