Fine-Tuning T5 on Question Answer dataset using Huggingface Transformer & PyTorch

Developers Hutt ยท Beginner ยท๐Ÿง  Large Language Models ยท2y ago
Skills: ML Pipelines53%

About this lesson

๐Ÿ“ In this video, we explore Text-to-Text Transfer Transformers, or T5 for short. T5 takes NLP tasks and converts them into a text-to-text format, making it incredibly versatile. Whether it's text classification, language translation, or text summarization, T5 can handle it all without modifying its architecture. โš ๏ธNote: Due to the model's size, we recommend using Google Colab or a GPU with 10GB+ VRAM. Here's what we cover in the video: * Importing libraries for machine learning, creating a dataset pipeline, and using transformers for a pre-trained model and tokenizer. * Loading the CoQA dataset into memory and preparing the data for training. * Setting up the T5 model, optimizer, and defining parameters. * Creating a data preprocessing pipeline and splitting the dataset for training and validation. *Training the model, monitoring training and validation loss, and saving the model and tokenizer. * Evaluating the model using the BLEU score, a metric for generated sentences compared to reference sentences. * Demonstrating the model's performance on a sample from the dataset. We're excited to continue exploring transformer models, fine-tuning, creating new models, and embarking on creative projects in this series. Drop your ideas for upcoming videos in the comments, and stay tuned for more exciting content. Facing issue? Discuss with me on social media Instagram: www.instagram.com/developershutt Thank you โค๏ธ for watching and joining us on this Transformers journey! Credits: Code: https://medium.com/@ajazturki10/simplifying-language-understanding-a-beginners-guide-to-question-answering-with-t5-and-pytorch-253e0d6aac54 Dataset: https://stanfordnlp.github.io/coqa/ Chapters: 0:00 Overview 2:04 Pre-requisites 2:12 Dataset 2:21 Dataset Overview 2:45 Coding 8:14 Wrapping up

Original Description

๐Ÿ“ In this video, we explore Text-to-Text Transfer Transformers, or T5 for short. T5 takes NLP tasks and converts them into a text-to-text format, making it incredibly versatile. Whether it's text classification, language translation, or text summarization, T5 can handle it all without modifying its architecture. โš ๏ธNote: Due to the model's size, we recommend using Google Colab or a GPU with 10GB+ VRAM. Here's what we cover in the video: * Importing libraries for machine learning, creating a dataset pipeline, and using transformers for a pre-trained model and tokenizer. * Loading the CoQA dataset into memory and preparing the data for training. * Setting up the T5 model, optimizer, and defining parameters. * Creating a data preprocessing pipeline and splitting the dataset for training and validation. *Training the model, monitoring training and validation loss, and saving the model and tokenizer. * Evaluating the model using the BLEU score, a metric for generated sentences compared to reference sentences. * Demonstrating the model's performance on a sample from the dataset. We're excited to continue exploring transformer models, fine-tuning, creating new models, and embarking on creative projects in this series. Drop your ideas for upcoming videos in the comments, and stay tuned for more exciting content. Facing issue? Discuss with me on social media Instagram: www.instagram.com/developershutt Thank you โค๏ธ for watching and joining us on this Transformers journey! Credits: Code: https://medium.com/@ajazturki10/simplifying-language-understanding-a-beginners-guide-to-question-answering-with-t5-and-pytorch-253e0d6aac54 Dataset: https://stanfordnlp.github.io/coqa/ Chapters: 0:00 Overview 2:04 Pre-requisites 2:12 Dataset 2:21 Dataset Overview 2:45 Coding 8:14 Wrapping up
Watch on YouTube โ†— (saves to browser)
Sign in to unlock AI tutor explanation ยท โšก30

Related Reads

๐Ÿ“ฐ
The Math Behind Every AI Agent: A Beginnerโ€™s Guide to LLM Intelligence
Learn the mathematical foundations behind LLM intelligence and why prompting alone is not enough for optimal results
Medium ยท AI
๐Ÿ“ฐ
The Math Behind Every AI Agent: A Beginnerโ€™s Guide to LLM Intelligence
Learn the math behind LLM intelligence and why prompting alone is not enough for AI agents
Medium ยท Machine Learning
๐Ÿ“ฐ
I Used AI for 30 Days Instead of Google. Hereโ€™s What Actually Changed
Replace Google with AI for 30 days to discover new ways of finding information and experience the benefits and limitations of AI-powered search
Medium ยท ChatGPT
๐Ÿ“ฐ
Changes to LLM pricing: Novita and StreamLake
Learn about the pricing changes for Novita and StreamLake LLMs and how they impact your projects
Dev.to AI

Chapters (6)

Overview
2:04 Pre-requisites
2:12 Dataset
2:21 Dataset Overview
2:45 Coding
8:14 Wrapping up
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch โ†’