BartForQuestionAnswering
Author: patil-suraj
Pull request: yes

This PR adds `BartForQuestionAnswering`.

Decided to add this models as `BART` is intended for both NLU and NLG tasks and also achieves comparable performance to `ROBERTa` on SQuAD.

Also fine-tuned the model [here](https://colab.research.google.com/drive/1I5cK1M_0dLaf5xoewh6swcm5nAInfwHy?usp=sharing). The metrics are slightly worse than given in the paper. Got following metrics on SQuADv1
`{'exact_match': 86.80227057710502, 'f1': 92.73424907872341}` 

@sshleifer , @patrickvonplaten 



Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4908?src=pr&el=h1) Report
> Merging [#4908](https://codecov.io/gh/huggingface/transformers/pull/4908?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/ac99217e92c43066af7ec96554054d75532565d7&el=desc) will **increase** coverage by `0.03%`.
> The diff coverage is `94.11%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4908/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4908?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #4908      +/-   ##
==========================================
+ Coverage   76.99%   77.02%   +0.03%     
==========================================
  Files         128      128              
  Lines       21602    21635      +33     
==========================================
+ Hits        16633    16665      +32     
- Misses       4969     4970       +1     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4908?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/\_\_init\_\_.py](https://codecov.io/gh/huggingface/transformers/pull/4908/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9fX2luaXRfXy5weQ==) | `99.13% <ø> (ø)` | |
| [src/transformers/modeling\_bart.py](https://codecov.io/gh/huggingface/transformers/pull/4908/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iYXJ0LnB5) | `96.26% <93.93%> (-0.15%)` | :arrow_down: |
| [src/transformers/modeling\_auto.py](https://codecov.io/gh/huggingface/transformers/pull/4908/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19hdXRvLnB5) | `78.40% <100.00%> (ø)` | |
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4908/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.49% <0.00%> (-0.12%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4908/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `87.42% <0.00%> (+0.15%)` | :arrow_up: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4908/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `73.49% <0.00%> (+0.40%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4908?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4908?src=pr&el=footer). Last update [ac99217...63eb191](https://codecov.io/gh/huggingface/transformers/pull/4908?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Thanks for the contribution @patil-suraj !

> Hi! Very cool @patil-suraj.
> 
> Could you also add `BartForQuestionAnswering` to the `all_model_classes` in `test_modeling_bart.py`?

Hi, @LysandreJik 
After adding `BartForQuestionAnswering` in `all_model_classes` I also had to add `output_attention` parameter to `forward`.

Now for some reason `test_attention_outputs` is failing, I am not sure why, could you help me fix it ?
Thanks !

Awesome work @patil-suraj - I can help you with this test :-) 

I see what the problem is...it's actually not related to your PR at all. Can we you for now just remove `BartForQuestionAnswering` from the all_models tuples in the tests. @LysandreJik @sshleifer I will open a new PR after this one to fix it :-) 

> I see what the problem is...it's actually not related to your PR at all. Can we you for now just remove `BartForQuestionAnswering` from the all_models tuples in the tests. @LysandreJik @sshleifer I will open a new PR after this one to fix it :-)

Thank you @patrickvonplaten . I've removed it from `all_models` tuple for now