import collections


def comp_initial(tags, treebank):
    """Compute initial probability for the given set of tags and training corpus

    Args:
        tags (list): list of unique tags from the corpus
        treebank (object): File object with train corpora loaded. nltk.corpus.reader.tagged.TaggedCorpusReader

    Returns:
        list: list of tuples containing POS tag and its initial probability. Size: 1 X K
    """
    
    parsed_sents = treebank.paras()
    f_tags = [line[0][1] for line in parsed_sents]
    freq_f_tags = collections.Counter(f_tags)
    init_p = [freq_f_tags[item]/len(f_tags) for item in list(tags)]
    return list(zip(list(tags), init_p))