

Evaluation
Evaluation for document question answering requires a significant amount of postprocessing. To avoid taking up too much
of your time, this guide skips the evaluation step. The [Trainer] still calculates the evaluation loss during training so
you're not completely in the dark about your model's performance. Extractive question answering is typically evaluated using F1/exact match.
If you'd like to implement it yourself, check out the Question Answering chapter
of the Hugging Face course for inspiration.
Train
Congratulations! You've successfully navigated the toughest part of this guide and now you are ready to train your own model.
Training involves the following steps:
* Load the model with [AutoModelForDocumentQuestionAnswering] using the same checkpoint as in the preprocessing.
* Define your training hyperparameters in [TrainingArguments].
* Define a function to batch examples together, here the [DefaultDataCollator] will do just fine
* Pass the training arguments to [Trainer] along with the model, dataset, and data collator.
* Call [~Trainer.train] to finetune your model.