Obtaining class mappings from learner/dataloaders

I’m trying to find the easiest way to obtain the mappings from the class index to the class label. For example if use a TextLearner to predict, I would like to map the index of each of the predicted probabilities to the corresponding class name.


1 Like

For text learners specifically it lives in dls.categorize.vocab. Normally it would be dls.vocab but it’s not the case here.

1 Like

Perfect, thanks a lot!