Newbie question: Finding sentence perplexity in a language model

Hi, all. I train a language model with ulmfit. I am able to use it to predict the next words given some text by calling learn_lm.predict(‘fastai is superb’, n_words=10).

However, I would like to get the perplexity of the sentence ‘fastai is superb’ with this language model. I am not sure how I should do it. Thank you very much.