File size: 352 Bytes
5fa1a76
 
 
 
 
 
 
1
2
3
4
5
6
7
From the Yelp Review dataset card, you know there are five labels:

from transformers import AutoModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained("google-bert/bert-base-cased", num_labels=5)

You will see a warning about some of the pretrained weights not being used and some weights being randomly
initialized.