def proportion_common_words(topics, topk=10):
    """
    compute proportion of unique words

    Parameters
    ----------
    topics: a list of lists of words
    topk: top k words on which the topic diversity will be computed

    Returns
    -------
    pcw : proportion of common words
    """
    if topk > len(topics[0]):
        raise Exception('Words in topics are less than '+str(topk))
    else:
        unique_words = set()
        for topic in topics:
            unique_words = unique_words.union(set(topic[:topk]))
        puw = 1 - (len(unique_words) / (topk * len(topics)))
        return puw