Calculating Perplexity in Language Models | CodeSignal Learn