def WhichTopic(text, ldamodel, corpus):
    """
    Find the most likely topic of text.

    Input:
    text -- list of text data;
    ldamodel -- a LDA model built by LDATopic;
    corpus -- a corpus built by LDATopic.
    Output:
    the most likely topic of each piece of text.
    """
    topic = []
    for i in range(len(text)):
        topic_index, topic_value = max(
            ldamodel[corpus[i]], key=lambda item: item[1])
        topic.append(topic_index)
    return topic