Hugging Face provides three ways to fine-tune a pretrained text classification model: PyTorch, Tensorflow Keras, and transformer trainer. Compared with the other two ways, PyTorch training loops provide more customization and easier debugging of the training loops. This tutorial will use PyTorch to fine-tune a text classification model. We will talk about the following:
👉 How does transfer learning work?
👉 How to convert a pandas dataframe into a Hugging Face Dataset?
👉 How to tokenize text, load a pretrained model, and train a transfer learning model using PyTorch training loops?
👉 How to make predictions and evaluate the model performance of a fine-tuned transfer learning model for text classification?
👉 How to save the model and re-load the model?
⏰ Timecodes ⏰
0:00 - Intro
0:59 - Step 0: Transfer Learning Algorithms
1:59 - Step 1: Install And Import Python Libraries
2:26 - Step 2: Download And Read Data
4:05 - Step 3: Train Test Split
4:33 - Step 4: Convert Pandas Dataframe to Hugging Face Dataset
5:49 - Step 5: Tokenize Text
9:25 - Step 6: DataLoader
10:00 - Step 7: Load Pretrained Model
10:32 - Step 8: Set Learning Rate Scheduler
11:12 - Step 9: PyTorch Training Loop
11:46 - Step 10: PyTorch Model Prediction and Evaluation
14:31 - Step 11: Save and Load Model
❤️ Blog post with code for this video: / transfer-learning-for-text-classification-...
📒 Code Notebook: https://mailchi.mp/087265e313c3/oub9z...
🚛 GrabNGoInfo Machine Learning Tutorials Inventory: / grabngoinfo-machine-learning-tutorials-inv...
🙏 Give me a tip to show your appreciation and help me keep providing free content: https://www.paypal.com/donate/?hosted...
✅ Join Medium Membership: If you are not a Medium member and want to support me to keep providing free content (😄 Buy me a cup of coffee ☕), join Medium membership through this link: / membership
You will get full access to posts on Medium for $5 per month, and I will receive a portion of it. Thank you for your support!
🎞️ NLP playlist: • NLP
📺 Videos mentioned in the video
Google Colab Tutorial for Beginners: • Google Colab Tutorial For Beginners
Customized Sentiment Analysis: Transfer Learning Using Tensorflow with Hugging Face: • Customized Sentiment Analysis | Transfer L...
Transfer Learning for Text Classification Using Hugging Face Transformers Trainer: • Transfer Learning for Text Classification ...
👩🏻💻 Follow me on LinkedIn: / grabngoinfo
🏪 Purchase data science and computer science themed products in my Amazon store: https://amzn.to/40HUTsl
🔥 Check out more machine learning tutorials on my website!
https://grabngoinfo.com/tutorials/
🛎️ SUBSCRIBE to GrabNGoInfo https://bit.ly/3keifBY
📧 CONTACT me at [email protected]
#textclassification #transferlearning #pytorch #NLP #deeplearning #grabngoinfo