Can we use GPT to assign a probability for a sentence given the previous sentences?

Hi!

I was wondering whether it is possible to use GPT to assign a probability for a sentence given the previous sentences (and if yes, how can we do that???).