Where do the Masked Language Model perform mask on the input data
# ❓ Questions & Help

<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to the Hugging Face forum: https://discuss.huggingface.co/ .
     You can also try Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. In this case, make sure to tag your
     question with the right deep learning framework as well as the
     huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     -->

## Details
<!-- Description of your issue -->

I am trying to pre-train a bert from scratch with my own word set using only the Masked Language Model. 
I have a trouble finding where exactly the code masks 15% of the words and replaces it with 80% mask, 10% random, and 10% original. 

I noticed that the input "labels" kind of refers to the places where words are masked. Does it mean that when I preprocess the data, I need to masked it myself and then indicates the position of masks in the "labels" input? If so, is "labels" the only input that would be affect? Is there any other input variables, such as the "masked_lm_positions" and "masked_lm_ids" in google-bert that I need to take care of?


<!-- You should first ask your question on the forum or SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on the forum/Stack Overflow**:
Hey @SusanSun8, we are trying to move "non-bugs" questions to the forum: https://discuss.huggingface.co/ . Could you maybe post your question there again? 

Here is the code that is responsible for Masked Language Modeling: https://github.com/huggingface/transformers/blob/f6cb0f806efecb64df40c946dacaad0adad33d53/src/transformers/data/data_collator.py#L107.