What is loss function for T5

Yes, you can use it here too.

You can leverage HuggingFace Datasets for this.