Masking ratio incorrect for DataCollatorForLanguageModeling
Author: anruijian
Pull request: no

### System Info

- `transformers` version: 4.26.0
- Platform: Linux-4.19.0-23-cloud-amd64-x86_64-with-debian-10.13
- Python version: 3.7.12
- Huggingface_hub version: 0.12.0
- PyTorch version (GPU?): 1.13.1+cu116 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: No 
- Using distributed or parallel set-up in script?: No

### Who can help?

@sgugger
@ArthurZucker 

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

It seems that there is an error in the implementation of the [torch_mask_tokens()](https://github.com/huggingface/transformers/blob/v4.26.1/src/transformers/data/data_collator.py#L750) method in the [DataCollatorForLanguageModeling](https://github.com/huggingface/transformers/blob/v4.26.1/src/transformers/data/data_collator.py#L609) class. 

According to the documentation, 80% of tokens are masked, 10% being replaced with the original tokens and 10% with random tokens. 
However, the implementation for replacing tokens with random ones sets the probability at 50% instead of the intended 10%.


``` python
indices_random = torch.bernoulli(torch.full(labels.shape, 0.5)).bool() & masked_indices & ~indices_replaced
random_words = torch.randint(len(self.tokenizer), labels.shape, dtype=torch.long)
inputs[indices_random] = random_words[indices_random]
```

EDIT: After a second look, it seems the logic here is that 80% tokens are masked, out of the remaining 20% tokens, half of them need to be replaced by random tokens.  So the probability 0.5 is correct. However, for [tf_mask_tokens()](https://github.com/huggingface/transformers/blob/v4.26.1/src/transformers/data/data_collator.py#L661), the probability is 0.1, which seems incorrect. Let me know if I understand it correctly!


``` python
indices_random = self.tf_bernoulli(input_shape, 0.1) & masked_indices & ~indices_replaced
random_words = tf.random.uniform(input_shape, maxval=vocab_size, dtype=tf.int64)
inputs = tf.where(indices_random, random_words, inputs)
```   

See the [link](https://github.com/huggingface/transformers/blob/v4.26.1/src/transformers/data/data_collator.py#L776) here.

Furthermore, I believe that the ratios for masked/original/random tokens should be configurable parameters that are accessible to users. At present, I have to inherit the `DataCollatorForLanguageModeling` class and override the `torch_mask_tokens` function in order to modify the ratio.

I can submit a pull request to address the bug and update the ratio parameter. Thank you very much!

Comments:
Note that the Transformers library is primarily a library of models, not data collators. This particular data collator should never have been added to the library proper but only in the example that uses it (it's also quite buggy and only works for BERT models). We welcome a PR with bug fixes (for the TF one apparently) but won't add more functionality to it.

@sgugger Thanks for the clarification. I will submit a PR for fixing the bug. 

@sgugger I have created a PR #21834  to fix the typo! Thank you!