# Masked language modelling with specific entities or POS

**URL:** <https://discuss.huggingface.co/t/masked-language-modelling-with-specific-entities-or-pos/8553>\
**Category:** 🤗Transformers\
**Created:** [July 21, 2021, 2:46pm UTC](https://discuss.huggingface.co/t/masked-language-modelling-with-specific-entities-or-pos/8553 "2021-07-21T14:46:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benj](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@benj](https://discuss.huggingface.co/u/benj)\
**Post date:** [July 21, 2021, 2:46pm UTC](https://discuss.huggingface.co/t/masked-language-modelling-with-specific-entities-or-pos/8553/1 "2021-07-21T14:46:17Z")

</div>

For a MLM task say with this input _“There are 42 `[MASK]` in `[MASK]`?”_. Is it possible to constrain the predicted `[MASK]` token to be a specific entity or POS? For example the second `[MASK]` token i would like the prediction to be a company name only so it may output something like:

1. “There are **42** employees in **Microsoft**?”
2. “There are **42** developers in **Microsoft**?”
3. “There are **42** employees in **Apple**?”  
… etc
