Artificial Intelligence, Machine Learning, Bert, Healthcare, AI.
Before we can use our model later on for inference, we need to save the map of labels to indexes into the model. def getConfig(raw_labels): label2id = {} id2label = {} for i, class_name in enumerate(raw_labels): label2id[class_name] = str(i) id2label[str(i)] = class_name return label2id, id2label