from transformers import AutoModelForSequenceClassification MODEL_NAME = "distilbert-base-uncased" id2label = { 0: "1.3.1 Info and Relationships", 1: "2.1.1 Keyboard", 2: "2.4.3 Focus Order", 3: "2.4.7 Focus Visible", 4: "4.1.2 Name, Role, Value", } label2id = { label: id for id, label in id2label.items() } model = AutoModelForSequenceClassification.from_pretrained( MODEL_NAME, num_labels=5, id2label=id2label, label2id=label2id, ) print(model.config)