Showing posts with label Hugging Face with Python – Full Hands-On Syllabus. Show all posts
Showing posts with label Hugging Face with Python – Full Hands-On Syllabus. Show all posts

Saturday, November 8, 2025

Full Hugging Face with Python syllabus only covering Python parts that are directly relevant to Hugging Face usage (so no generic Python basics, since you’ll cover those separately).

Hugging Face with Python – Full Hands-On Syllabus


Section 1 – Introduction & Setup

Goal: Understand Hugging Face ecosystem, install and set up environment.

  1. What is Hugging Face?

    • Transformers library

    • Datasets library

    • Tokenizers library

    • Model Hub

    • Spaces

  2. Installation & Environment Setup

    • Installing transformers, datasets, huggingface_hub, evaluate

    • Python virtual environments (venv, conda) for HF projects

    • Setting up a free Hugging Face account and API token

  3. First Hands-on: Load a pre-trained model and tokenizer.

    from transformers import pipeline
    classifier = pipeline("sentiment-analysis")
    print(classifier("Hugging Face is awesome!"))
    

Mini Project:
Sentiment Analyzer – User enters text, script returns positive/negative with confidence score.


Section 2 – Transformers Fundamentals

Goal: Learn model loading, tokenization, pipelines, and inference.

  1. Pre-trained Models & Pipelines

    • Text classification

    • Named Entity Recognition (NER)

    • Question Answering

    • Text Generation

  2. Tokenizer Basics

    • Tokenization process (subword, wordpiece, BPE)

    • Encoding and decoding text

    • Padding, truncation, attention masks

  3. Hands-on Exercises:

    • Load different models from transformers

    • Tokenize custom text and see token IDs

    • Decode token IDs back to text

Mini Project:
Custom NER Tool – Extract names, locations, and organizations from text.


Section 3 – Working with Hugging Face Datasets

Goal: Learn to load, explore, preprocess, and split datasets.

  1. Datasets Basics

    • Loading built-in datasets (IMDB, SQuAD, etc.)

    • Loading CSV/JSON from local or URL

    • Dataset structure: features, splits, metadata

  2. Data Processing

    • Filtering, mapping, and formatting datasets

    • Tokenizing entire datasets efficiently (map with batched processing)

    • Train/validation/test split

  3. Hands-on:

    • Load IMDB reviews dataset

    • Preprocess for classification task

Mini Project:
Text Cleaner & Preprocessor – Load dataset, clean text, tokenize, and prepare for model training.


Section 4 – Fine-tuning Pre-trained Models

Goal: Learn to train and fine-tune models for custom tasks.

  1. Training Setup

    • Understanding AutoModelForSequenceClassification

    • Trainer API basics

    • TrainingArguments configuration

  2. Fine-tuning Steps

    • Load dataset → Tokenize → Model definition → Trainer → Train

    • Saving and loading fine-tuned models

  3. Hands-on:

    • Fine-tune BERT for sentiment classification

    • Evaluate using evaluate library

Mini Project:
Movie Review Sentiment Classifier – Fine-tune BERT on IMDB dataset.


Section 5 – Advanced Fine-tuning & Customization

Goal: Handle larger models, optimize training, and customize architectures.

  1. Training Optimization

    • Mixed precision training

    • Gradient accumulation

    • Data collators for dynamic padding

  2. Custom Models

    • Modify architecture layers

    • Use AutoModel for non-classification tasks

  3. Saving & Sharing Models

    • Push to Hugging Face Hub with API token

    • Load directly from Hub in another project

Mini Project:
Custom Toxic Comment Detector – Fine-tune DistilBERT with additional custom classification layers.


Section 6 – Beyond NLP: Vision & Audio Models

Goal: Explore non-text models in Hugging Face.

  1. Image Models

    • Image classification pipeline (vit, resnet)

    • Image segmentation

  2. Audio Models

    • Speech-to-text (whisper)

    • Audio classification

  3. Hands-on:

    • Classify images using pipeline("image-classification")

    • Convert speech to text

Mini Project:
Speech Sentiment Detector – Convert audio to text, run sentiment analysis.


Section 7 – Deployment & Integration

Goal: Deploy and use models in real applications.

  1. FastAPI Integration – Create REST API for HF models

  2. Streamlit/Gradio Apps – Interactive UIs

  3. Hugging Face Spaces Deployment – Free hosting for models and apps

Mini Project:
Text Summarization Web App – Users paste an article, model outputs a summary.


Section 8 – Advanced Topics & Research

Goal: Explore cutting-edge Hugging Face features.

  1. PEFT & LoRA – Parameter-efficient fine-tuning for large models

  2. Transformers for RAG – Retrieval-Augmented Generation with transformers + faiss

  3. Multi-task models – Train one model for multiple tasks

  4. Quantization & Model Optimization – Run large models on small hardware

Capstone Project Ideas:

  • AI Customer Support Bot (QA + summarization + sentiment analysis)

  • RAG-based PDF Question Answering System (LangChain + HF models)

  • Multi-modal AI (text + image inputs)


📌 Teaching Flow Tip:

  • Start each section with concepts, then code-along examples, then a small hands-on task.

  • Include model training on free Google Colab to keep costs zero.

  • End with a capstone project combining multiple Hugging Face capabilities.




Are you a BIT student struggling with your final year project or looking for expert guidance to ace your UCSC final year project? 💡 We've got you covered!  


✅ What We Offer:  

- Personalized project consultations  

- Step-by-step project development guidance  

- Expert coding and programming assistance (PHP, Python, Java, etc.)  

- Viva preparation and documentation support  

- Help with selecting winning project ideas  


📅 Class Schedules:  

- Weekend Batches: Flexible timings for working students  

- Online & In-Person Options  


🏆 Why Choose Us?  

- Proven track record of guiding top BIT projects  

- Hands-on experience with industry experts  

- Affordable rates tailored for students  


🔗 Enroll Now: Secure your spot today and take the first step toward project success!  


📞 Contact us: https://web.facebook.com/itclasssrilanka  

📍 Location: Online  

🌐 Visit us online: https://localedxcelcambridgeictcomputerclass.blogspot.com/


✨ Don't wait until the last minute! Start your BIT final year project with confidence and guidance from the best in the industry. Let's make your project a success story!  


---

Individual attention to all students 

🎓 Final Year IT & Computer Science Students! 🚀

Get Expert Guidance for Your Degree Projects & Reports!


📍 Colombo | Moratuwa | UoM | Colombo Uni | BIT | BIT Degree | SLIIT | BSc


💡 We Specialize In:

✅ Project Proposal Writing (University-Ready)

✅ Interim Report Assistance

✅ Final Dissertation / Use Case Document Support

✅ Test Manual & Installation Guides

✅ Complete Final-Year Project System (Fully Working)

✅ Test Document Preparation

✅ Computer Studies / BIT / Software Engineering / IT / VLE Courses


👨‍🏫 Supervision by Experienced Software Developers & University Project Guides

📘 Covers: Java, Python, PHP, MySQL, AI, Web & Mobile Development, Machine Learning


📞 Contact Now to Book Your Slot – Limited Project Guidance Available!