Out of context word

Hello everyone,

I know that Bert and other language models’ main task is to predict the most appropriate word to fill the masked token.

But is there a way to use these models to detect out-of-context words in a sentence??

Thanks a lot,