doc length for test data
perplexity calculation