Machine Learning, AI, NLP, Programming, Deep Dives.
label in enumerate(unique_labels)} label2id = {label: i for i, label in enumerate(unique_labels)} config = AutoConfig.from_pretrained(model_name) config.id2label = id2label config.label2id = label2id # Verify the correct labels print("ID to Label Mapping:", config.id2label) print("Label to ID