# supporting function def compute_coherence_values(corpus, dictionary, k, a, b): lda_model = gensim.models.LdaMulticore(corpus=corpus, id2word=dictionary, num_topics=k, random_state=100, chunksize=100, passes=10, alpha=a, eta=b) coherence_model_lda = CoherenceModel(model=lda_model, texts=data_lemmatized, dictionary=id2word, coherence='c_v') return coherence_model_lda.get_coherence()