# Creating masked sentences

**URL:** <https://discuss.huggingface.co/t/creating-masked-sentences/15184>\
**Category:** 🤗Datasets\
**Created:** [February 27, 2022, 10:10pm UTC](https://discuss.huggingface.co/t/creating-masked-sentences/15184 "2022-02-27T22:10:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssam9](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@ssam9](https://discuss.huggingface.co/u/ssam9)\
**Post date:** [February 27, 2022, 10:10pm UTC](https://discuss.huggingface.co/t/creating-masked-sentences/15184/1 "2022-02-27T22:10:07Z")

</div>

Hi,

I am retraining Roberta and want to evaluate the MLM accuracy to check the difference before retraining and after retraining. I know that we can use a data collator during retraining for generating masked input.

But for evaulating, if I have a selected set of 100 sentences, how can I generate a masked version of these sentences?

For example, if the sentence was: This movie was very interesting to watch  
I want to have a sentence that looks like this: This movie was very ###### to watch.

How to do this?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/64813_2.png) [@lhoestq](https://discuss.huggingface.co/u/lhoestq)\
**Post date:** [March 2, 2022, 10:44am UTC](https://discuss.huggingface.co/t/creating-masked-sentences/15184/2 "2022-03-02T10:44:12Z")

</div>

Hi ! You can use the data collator for evaluation as well
