add perplexity measure