NLP, Topic Modeling, Data Science, Nlp Tutorial, Machine Learning.
create a helper function that will print the top 15 words of each topic: def display_top_words(n_top_words=15, feature_names, nmf): for i, topic_vec in enumerate(nmf.components_): print(i, end=' ') for fid in topic_vec.argsort()[-1:-n_top_words-1:-1]: print(feature_names[fid], end=' ') print()