There are function(s) to be completed in this section!

Due to how the imports are set up and because the intent and slot classifier is part of the social-interaction-cloud python package when you make changes you need to make sure to reinstall the social interaction cloud via pip install .

In this part of the assignment, you’ll complete the train_model function in train.py, which trains a BERT-based model for intent classification and slot filling. This task will deepen your understanding of the training process, how loss functions work for multi-task learning, and how to use backpropagation to optimize a model.


Understanding Training

For more general and preliminary information check out: [TBC]Preliminaries and Quiz Materials.

  1. What is Training?

  2. How Does the Training Loop Work?

  3. What Are We Optimizing?

  4. Why Do We Use Two Loss Functions?


Steps to Complete the train_model Function

The train_model function is incomplete, and your task is to fill in the missing pieces. This function is the backbone of the training process for a dual-task model that handles intent classification and slot filling. Through this exercise, you’ll learn how to integrate loss functions, perform forward passes, and optimize a model’s weights effectively.


Assignment: Completing the Training Function


Objective

The train_model function is incomplete, and your task is to fill in the missing pieces. This function is the backbone of the training process for a dual-task model that handles intent classification and slot filling. Through this exercise, you’ll learn how to integrate loss functions, perform forward passes, and optimize a model’s weights effectively.


Understanding the Missing Slots

  1. Loss Functions

    Questions to Consider:


  1. Optimizer

    Questions to Consider:


  1. Forward Pass

    Questions to Consider:


  1. Loss Calculation

    Questions to Consider:


  1. Backpropagation

    Questions to Consider:


  1. Loss Logging

    Questions to Consider:


Hints for Success


By completing this assignment, you’ll gain hands-on experience with key components of model training, preparing you for more advanced tasks. Take your time, think critically, and ask for clarification if needed!


Reflection Questions: Check out the Questions to Consider in each section.

Done? Proceed with https://socialrobotics.atlassian.net/wiki/spaces/PCA2/pages/2730328132 .