Simple Transformers Multilabelclassification
Hi there, I am having trouble importing DistilBertForMultilabelSequenceClassificationIn the attached two pictures you can see I am having no issues importing the AutoModelForSequenceClassification but when I try and import the DistilBertForMultilabelSequenceClassification I get:ImportError Traceback (most recent call last)Cell In [3], line 1----> 1 from transformers import AutoTokenizer, DistilBertForMultilabelSequenceClassification3 tokenizer = AutoTokenizer.from_pretrained(“bhadresh-savani/bert-base-go-emotion”)5 model = DistilBertForMultilabelSequenceClassification.from_pretrained(“bhadresh-savani/bert-base-go-emotion”)ImportError: cannot import name ‘DistilBertForMultilabelSequenceClassification’ from ‘transformers’ (C:\Users\name\AppData\Roaming\Python\Python310\site-packages\transformers_init_.py)
2022-10-18T08:18:57Z
Hi,the correct way to instantiate a DistilBERT model for multi-label text classification is as follows:from transformers import DistilBertForSequenceClassification

model = DistilBertForSequenceClassification.from_pretrained("distilbert-base-uncased", problem_type="multi_label_classification", num_labels=10)