Summary
In this chapter, we discussed how to fine-tune a pre-trained model for any text classification downstream task. We fine-tuned the models using sentiment analysis, multi-class classification, and sentence-pair classification – more specifically, sentence-pair regression and multi-label classification. We worked with a well-known IMDb dataset and our own custom dataset to train the models. While we took advantage of the Trainer
class to cope with much of the complexity of the processes for training and fine-tuning, we learned how to train from scratch with native libraries to understand forward propagation and backpropagation with the transformers
library. To summarize, we discussed and conducted fine-tuning single-sentence classification with Trainer
, sentiment classification with native PyTorch without Trainer
, single-sentence multi-class classification, multi-label classification, and fine-tuning sentence-pair regression.
In the next chapter, we will learn how to...