Complete the code to import the pyLDAvis library.
import [1]
pyLDAvis is the library used to visualize topic models like LDA.
Complete the code to prepare the visualization data for an LDA model.
vis_data = pyLDAvis.[1](lda_model, corpus, dictionary)plot or show instead of prepare.The prepare function creates the data needed for visualization from the model, corpus, and dictionary.
Fix the error in the code to display the pyLDAvis visualization in a Jupyter notebook.
pyLDAvis.[1](vis_data)display which is not a pyLDAvis function.plot or render which do not exist.The show function displays the interactive visualization in Jupyter notebooks.
Fill both blanks to create a dictionary comprehension that filters topics with probability greater than 0.1.
filtered_topics = {topic: prob for topic, prob in topic_probs.items() if prob [1] [2]The comprehension keeps topics where the probability is greater than 0.1.
Fill all three blanks to create a dictionary comprehension that maps topic names to their top words if the word frequency is above 0.05.
top_words = {topic[1]: word for topic, words in topic_word_dist.items() for word, freq in words if freq [2] [3]This comprehension creates a dictionary with topic names in uppercase as keys and words as values, filtering words with frequency greater than 0.05.