Updated GLUE script. New feature: Binary mask creation from the tokenizer's encoding.
Author: LysandreJik
Pull request: yes

The new `tokenizer.encode(seq_0, seq_1, add_special_tokens=True)` method makes life easier when building sequences. However, it makes it harder to create binary masks as the different sequence lengths are unknown. As a feature, I have therefore added a flag to the encode function so that it can output binary masks.

Example:
```py
from pytorch_transformers import BertTokenizer

tokenizer = BertTokenizer.from_pretrained("bert-base-cased")
seq_0 = "This is the one"
seq_1 = "This is the last"

input_ids, mask = tokenizer.encode(seq_0, seq_1, add_special_tokens=True, output_mask=True)
# input_ids: [ 101, 1188, 1110, 1103, 1141,  102, 1188, 1110, 1103, 1314, 102]
# mask:      [   0,    0,    0,    0,    0,    0,    1,    1,    1,    1,   1]
```

It works for BERT, RoBERTa, XLM, and XLNet. I have refactored the GLUE example with this method. It greatly simplifies input creation. 

I have added an additional unit test to the `commontests` suite. Furthermore, in order to make sure the tokenization was correct I compared against the original input creation of the GLUE script to make sure every encoded sequence remained the same.

Comments:
# [Codecov](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182?src=pr&el=h1) Report
> Merging [#1182](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/pytorch-transformers/commit/0d1dad6d5323cf627cb8d7ddd428856ab8475f6b?src=pr&el=desc) will **increase** coverage by `0.27%`.
> The diff coverage is `94.57%`.

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

```diff
@@            Coverage Diff             @@
##           master    #1182      +/-   ##
==========================================
+ Coverage   80.77%   81.04%   +0.27%     
==========================================
  Files          57       57              
  Lines        8092     8229     +137     
==========================================
+ Hits         6536     6669     +133     
- Misses       1556     1560       +4
```


| [Impacted Files](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pytorch\_transformers/tokenization\_xlnet.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdG9rZW5pemF0aW9uX3hsbmV0LnB5) | `89.65% <100%> (+0.46%)` | :arrow_up: |
| [...h\_transformers/tests/tokenization\_tests\_commons.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdGVzdHMvdG9rZW5pemF0aW9uX3Rlc3RzX2NvbW1vbnMucHk=) | `100% <100%> (ø)` | :arrow_up: |
| [pytorch\_transformers/tokenization\_bert.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdG9rZW5pemF0aW9uX2JlcnQucHk=) | `95.75% <100%> (+0.08%)` | :arrow_up: |
| [...ytorch\_transformers/tests/tokenization\_xlm\_test.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdGVzdHMvdG9rZW5pemF0aW9uX3hsbV90ZXN0LnB5) | `97.72% <100%> (ø)` | :arrow_up: |
| [pytorch\_transformers/tokenization\_xlm.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdG9rZW5pemF0aW9uX3hsbS5weQ==) | `82.98% <100%> (+0.28%)` | :arrow_up: |
| [...ch\_transformers/tests/tokenization\_roberta\_test.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdGVzdHMvdG9rZW5pemF0aW9uX3JvYmVydGFfdGVzdC5weQ==) | `92.45% <100%> (ø)` | :arrow_up: |
| [...transformers/tests/tokenization\_distilbert\_test.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdGVzdHMvdG9rZW5pemF0aW9uX2Rpc3RpbGJlcnRfdGVzdC5weQ==) | `95.23% <100%> (ø)` | |
| [pytorch\_transformers/tokenization\_roberta.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdG9rZW5pemF0aW9uX3JvYmVydGEucHk=) | `100% <100%> (ø)` | :arrow_up: |
| [...torch\_transformers/tests/tokenization\_bert\_test.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdGVzdHMvdG9rZW5pemF0aW9uX2JlcnRfdGVzdC5weQ==) | `98.66% <100%> (ø)` | :arrow_up: |
| [...orch\_transformers/tests/tokenization\_xlnet\_test.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdGVzdHMvdG9rZW5pemF0aW9uX3hsbmV0X3Rlc3QucHk=) | `97.91% <100%> (ø)` | :arrow_up: |
| ... and [1 more](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182?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/pytorch-transformers/pull/1182?src=pr&el=footer). Last update [0d1dad6...72402d1](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1182?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


I like it a lot! Could we also update `run_squad` similarly maybe?

Only need to adapt the SQuAD script with the new encode w/mask as well as DistilBERT and I think we're good to go @julien-c