I am looking for a NLP model that tells me how probable/reasonable a given word is within the context of some other words or word sequences.
Consider the sentence “I build a house.” which is a reasonable sentence.
Now, what I want to know is P(“build” | “I”, “a house”) or to put it differently model.score(“I build a house”).
This means, I want to know how reasonable this sentence is and I would expect a score or probability that is significantly different from zero.
Please note: I do not want to predict a word but rather I want to know if an already existing sequence of words is reasonable ie. makes sense.
A negative example for a sentence/word sequence that does not make any sense would be the sentence “I build a soup”.
In this case model.score(“I build a soup”) or P(“build” | “I”, “a soup”) should be close to zero or a least extremely low.
Do you know of any model that can accomplish this task?