Hi, Iâ€™m doing a linguistic research and Iâ€™m using GPT-2 model.

I have two sentences: one is correct and the other one has some atypical elements which makes it strange.

Iâ€™d like to use GPT-2 to get the probabilities of both the sentences and see if the model understands which one is linguistically correct.

How can I do?

Hi @caput maybe these two links help:

gpt_sent_prob

Generation Probabilities: How to compute probabilities of output scores for GPT2