Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🤗 Hugging Face Transformers with Python – First Edition

Welcome to the Hugging Face Transformers with Python course! This comprehensive guide is designed to help you master state-of-the-art Natural Language Processing (NLP) using the Hugging Face transformers library and Python.

Change this part bro!

📘 Course Overview

This course covers the fundamentals and advanced concepts of using Hugging Face Transformers for modern NLP tasks. You’ll learn everything from tokenization and fine-tuning to deployment.


🧠 Prerequisites

  • Python 3.7+
  • Basic understanding of machine learning and NLP
  • Familiarity with PyTorch or TensorFlow (not mandatory but helpful)
  • Jupyter Notebook (recommended)

🗂 Course Breakdown

📦 1. Introduction to Hugging Face and Transformers

  • What are Transformers?
  • Overview of Hugging Face ecosystem
  • Installing transformers, datasets, and tokenizers
  • Setting up GPU/Colab environment

🔤 2. Tokenization

  • Understanding tokenizers
  • Using AutoTokenizer
  • Padding, truncation, attention masks
  • Byte-Pair Encoding (BPE), WordPiece, Unigram

🧠 3. Pretrained Models

  • Overview of model architectures (BERT, GPT, T5, DistilBERT, etc.)
  • Using AutoModel, AutoModelForSequenceClassification, etc.
  • Loading and testing models from the 🤗 Hub

🧾 4. Text Classification

  • Sentiment analysis with BERT
  • Training a classifier with Trainer API
  • Evaluating model performance (accuracy, F1, etc.)

❓ 5. Question Answering

  • Using pipeline for QA
  • Fine-tuning BERT on SQuAD
  • Using context and questions effectively

🗣 6. Text Generation

  • Generating text using GPT-2 / GPT-3
  • Sampling techniques: top-k, top-p (nucleus), temperature
  • Prompt engineering basics

🧩 7. Named Entity Recognition (NER)

  • Token classification with BERT
  • Label alignment with subword tokens
  • Training on CoNLL or custom datasets

🔁 8. Translation and Summarization

  • Using MarianMT, T5, and BART
  • Translation between languages
  • Summarizing long documents with Transformers

🛠 9. Custom Datasets and Tokenizers

  • Using datasets library
  • Processing and tokenizing custom CSV, JSON, text
  • Mapping dataset for training

🎓 10. Fine-Tuning Transformers (Advanced)

  • Custom training loops with PyTorch
  • Gradient accumulation and mixed precision
  • Using Hugging Face Trainer and TrainingArguments

🚀 11. Model Deployment

  • Saving and sharing models on Hugging Face Hub
  • Deploying with transformers, Gradio, and FastAPI
  • Inference optimization with ONNX and optimum

🧪 12. Evaluation and Experiment Tracking

  • Using evaluate and accelerate
  • Logging with TensorBoard, Weights & Biases
  • Performance monitoring and reproducibility

💾 Tools & Libraries Used

  • transformers
  • datasets
  • evaluate
  • tokenizers
  • torch / tensorflow
  • accelerate
  • Gradio / Streamlit
  • scikit-learn

📁 Folder Structure (if this is a code repo)

huggingface-transformers-course/
│
├── notebooks/                  # Jupyter Notebooks for each lesson
├── datasets/                   # Sample and custom datasets
├── models/                     # Saved/Exported models
├── utils/                      # Helper functions
├── requirements.txt            # Python dependencies
└── README.md                   # This file

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors