Calculates the perplexity of LDA models over a range of K topics to help determine the optimal number of topics.
ttm_perplexity(text_vector, k_range = 2:5, seed = 1234)A data frame containing K and the corresponding perplexity score.
A character vector of aggregated student responses (length N).
A numeric vector indicating the number of topics to try (e.g., 2:10).
Integer seed for reproducibility.