Text this: Understanding the training function