Is there a DataCollator for Question Answering?

Hi there,

I can find several Data Collators, for example one for Masked Language modelling ( DataCollatorForLanguageModeling ). That way we have been able to pretrain our custom language model.

Now we would like to train on a Question Answering downstream task using the Squad v2 dataset. However, we can’t find a DataCollator class related to Question Answering.

What is the correct way to train a Question Answering model for the Squad V2 dataset using huggingface?

Thanks in advance for any hints and pointers!

You should have a look at the official question answering examples.

1 Like