def gen_grams(clean_list, gram):

    """
    Helper function to generate ngrams
    :param clean_list: list of words
    :param gram: size of ngram to generate
    :return: zip object

    """
    if gram == "bigram":

        bigrams = zip(clean_list, clean_list[1:])  # compute bigrams
        return bigrams

    elif gram=="trigram":
        trigrams = zip(clean_list, clean_list[1:], clean_list[2:])  # compute trigrams
        return trigrams

    else:
        return zip(clean_list)