bert
bert copied to clipboard
how to get the probability of a missing word in a sentence
How can I directly get the probability of a missing word in a sentence?
Specifically my sentence is "we <missing_word> chocolate" and I need to get the likelihood ratio between "we love chocolate" and "we hate chocolate".
Also, thank you so much for this code.
This is what the masked LM does, so you can just look at the run_pretraining.py code to see how it computes the masked LM log probabilities and just use that. It will only work for single WordPieces though.