Get the loss in LongformerForQuestionAnswering for fine-tuning
Hello,

I'm trying to fine-tune **LongformerForQuestionAnswering** on a custom dataset. I've written a script for training (without using hugging face _Trainer_), and I need the loss of the model for that. On the Longformer docs page, it's written that : 

**loss** (torch.FloatTensor of shape (1,), optional, returned when labels is provided) – Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.

Meaning that the model is supposed to return **loss** when the input _label_ is provided, however, the model takes no such an input (it's not mentioned in the doc, and the model generates an error when passing the input (label=...))

I've noticed that for **LongformerForMaskedLM** this is not an issue since the model does take _label_ as an input. 

I am wondering if there is a way to get the **loss** from LongformerForQuestionAnswering and perhaps to correct this on the docs page. 
Thanks! 

In HuggingFace Transformers, `xxxForQuestionAnswering` models don't take a `labels` argument as input. Rather, one should provide `start_positions` and `end_positions`. These indicate which token are the start of the answer, and which token are the end of the answer.

Check out this notebook which showcases how to fine-tune a model for question-answering: https://github.com/huggingface/notebooks/blob/master/examples/question_answering.ipynb

<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.