Closed Shea-Fyffe closed 3 years ago
Hi @Shea-Fyffe
Thanks for raising the issue and sharing your code to reproduce it!
In the current implementation, TARSClassifier
relies on the label_dictionary
argument passed in the constructor call to determine whether the classification task is a multi-class or multi-labelling problem. In your case, every text example has a single label and that signals the TARSClassifier
to treat it as a multi-class problem (with softmax enabled in the end). Consider changing the make corpus
and load TARS
section in your example to the following to treat it as a multi-labelling problem:
#1. make corpus
crpus = Corpus(train=train_data)
label_dict = crpus.make_label_dictionary()
label_dict.multi_label = True
#Run predictions
#2. load TARS
tars = TARSClassifier(task_name = "behaviors",
label_dictionary = label_dict,
document_embeddings = "paraphrase-mpnet-base-v2",
batch_size = 16)
Hope this helps. Good luck!
with regards, Kishaloy
Closing, but feel free to reopen if you have more questions!
Closing, but feel free to reopen if you have more questions!
I was unsure of how to re-open this issue so I mentioned it in a new yet somewhat related issue #2410
I am attempting to fine-tune a few-shot text classification model with several training examples. Each training example only has one true label.
I am trying to predict multi-label probabilities (i.e., don't sum up to 1), for unlabeled data. With the example code below my probabilities sum to 1. Is there something that sticks out or a way I can avoid the softmax at the end?
Let me know if there is anything missing!
Thanks for being awesome