inputs["start_positions"] = start_positions
inputs["end_positions"] = end_positions
return inputs
```
Apply the preprocessing function over the entire dataset with 🤗 Datasets map function:
python
tokenized_squad = squad.map(preprocess_function, batched=True, remove_columns=squad["train"].column_names)
Batch the processed examples together:
```python
from transformers import default_data_collator
data_collator = default_data_collator
```
Fine-tune with the Trainer API
Load your model with the [AutoModelForQuestionAnswering] class:
```python
from transformers import AutoModelForQuestionAnswering, TrainingArguments, Trainer
model = AutoModelForQuestionAnswering.from_pretrained("distilbert-base-uncased")
```
Gather your training arguments in [TrainingArguments]:
python
training_args = TrainingArguments(
