Forms the aggregated dictionary that maps lemmas/stems to the most popular topic keyword.

    Inputs: - annotated_nodes: A numpy array of anonymized nodes that are annotated.
            - node_to_lemma_tokeywordbag: A map from nodes to maps from lemmas to bags of keywords.

    Output: - lemma_to_keyword: A dictionary that maps lemmas to keywords.

def form_lemma_tokeyword_map(annotated_nodes, node_to_lemma_tokeywordbag):
    """
    Forms the aggregated dictionary that maps lemmas/stems to the most popular topic keyword.

    Inputs: - annotated_nodes: A numpy array of anonymized nodes that are annotated.
            - node_to_lemma_tokeywordbag: A map from nodes to maps from lemmas to bags of keywords.

    Output: - lemma_to_keyword: A dictionary that maps lemmas to keywords.
    """
    # Reduce relevant lemma-to-original keyword bags.
    lemma_to_keywordbag = defaultdict(lambda: defaultdict(int))
    for node in annotated_nodes:
        for lemma, keywordbag in node_to_lemma_tokeywordbag[node].items():
            for keyword, multiplicity in keywordbag.items():
                lemma_to_keywordbag[lemma][keyword] += multiplicity

    lemma_to_keyword = dict()
    for lemma, keywordbag in lemma_to_keywordbag.items():
        lemma_to_keyword[lemma] = max(keywordbag.items(), key=itemgetter(1))[0]

    return lemma_to_keyword