def lda_topic_top_words(lda_mod, n_top_words=6):

    """
    Extract the top n words for each K topic, and convert results in a dictionary:
    - keys are the K topics
    - 2 values: first value is the list of top words, second value is the list of corresponding word probabilities
    
    Input parameter:
    ----------------
    lda mod : gensim lda model
    n_top_words : number of top words per topic to be exracted
        
    """

    # extract n top word for each topic and their probabilties, and save them as a dictionary
    mydict = {}
    for t in range(lda_mod.num_topics):
        ws = []
        w_probs = []
        for n in range(n_top_words):
            w, w_prob = lda_mod.show_topic(t, n_top_words)[n]
            ws.append(w)
            w_probs.append(w_prob)
        mydict[t] = ws, w_probs

    return mydict